From dd51e1b8af7a2d6324a459468a17f794ed1f66f7 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 3 Sep 2024 11:54:33 +0000 Subject: [PATCH 1/2] feat(v1): promote block_project_ssh_keys support to batch v1 API PiperOrigin-RevId: 670424240 Source-Link: https://github.com/googleapis/googleapis/commit/4bf146f05883186375b4192b8c3b441398bab3d1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/38ece342ba3cdf07db6b5e3c37252ae8f3f7ade6 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLWJhdGNoLXYxLy5Pd2xCb3QueWFtbCIsImgiOiIzOGVjZTM0MmJhM2NkZjA3ZGI2YjVlM2MzNzI1MmFlOGYzZjdhZGU2In0= --- .../google-cloud-batch-v1/.gitignore | 22 + .../google-cloud-batch-v1/.repo-metadata.json | 15 + .../google-cloud-batch-v1/.rubocop.yml | 33 + .../google-cloud-batch-v1/.toys.rb | 28 + .../google-cloud-batch-v1/.yardopts | 12 + .../google-cloud-batch-v1/AUTHENTICATION.md | 122 ++ .../google-cloud-batch-v1/CHANGELOG.md | 2 + owl-bot-staging/google-cloud-batch-v1/Gemfile | 11 + .../google-cloud-batch-v1/LICENSE.md | 201 ++++ .../google-cloud-batch-v1/README.md | 141 +++ .../google-cloud-batch-v1/Rakefile | 169 +++ .../google-cloud-batch-v1/gapic_metadata.json | 48 + .../google-cloud-batch-v1.gemspec | 30 + .../lib/google-cloud-batch-v1.rb | 22 + .../lib/google/cloud/batch/v1.rb | 45 + .../lib/google/cloud/batch/v1/batch_pb.rb | 64 + .../google/cloud/batch/v1/batch_service.rb | 58 + .../cloud/batch/v1/batch_service/client.rb | 1025 +++++++++++++++++ .../batch/v1/batch_service/credentials.rb | 47 + .../batch/v1/batch_service/operations.rb | 809 +++++++++++++ .../cloud/batch/v1/batch_service/paths.rb | 113 ++ .../cloud/batch/v1/batch_service/rest.rb | 56 + .../batch/v1/batch_service/rest/client.rb | 963 ++++++++++++++++ .../batch/v1/batch_service/rest/operations.rb | 902 +++++++++++++++ .../v1/batch_service/rest/service_stub.rb | 424 +++++++ .../cloud/batch/v1/batch_services_pb.rb | 57 + .../cloud/batch/v1/bindings_override.rb | 102 ++ .../lib/google/cloud/batch/v1/job_pb.rb | 75 ++ .../lib/google/cloud/batch/v1/rest.rb | 38 + .../lib/google/cloud/batch/v1/task_pb.rb | 66 ++ .../lib/google/cloud/batch/v1/version.rb | 28 + .../lib/google/cloud/batch/v1/volume_pb.rb | 44 + .../lib/google/iam/v1.rb | 43 + .../lib/google/iam/v1/bindings_override.rb | 100 ++ .../lib/google/iam/v1/iam_policy.rb | 77 ++ .../lib/google/iam/v1/iam_policy/client.rb | 680 +++++++++++ .../google/iam/v1/iam_policy/credentials.rb | 42 + .../lib/google/iam/v1/iam_policy/rest.rb | 75 ++ .../google/iam/v1/iam_policy/rest/client.rb | 641 +++++++++++ .../iam/v1/iam_policy/rest/service_stub.rb | 247 ++++ .../lib/google/iam/v1/rest.rb | 36 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 420 +++++++ .../proto_docs/google/api/field_behavior.rb | 85 ++ .../proto_docs/google/api/field_info.rb | 88 ++ .../proto_docs/google/api/launch_stage.rb | 71 ++ .../proto_docs/google/api/resource.rb | 227 ++++ .../proto_docs/google/cloud/batch/v1/batch.rb | 215 ++++ .../proto_docs/google/cloud/batch/v1/job.rb | 743 ++++++++++++ .../proto_docs/google/cloud/batch/v1/task.rb | 537 +++++++++ .../google/cloud/batch/v1/volume.rb | 86 ++ .../proto_docs/google/iam/v1/iam_policy.rb | 87 ++ .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 +++++++ .../google/longrunning/operations.rb | 164 +++ .../proto_docs/google/protobuf/any.rb | 145 +++ .../proto_docs/google/protobuf/duration.rb | 98 ++ .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++++ .../proto_docs/google/protobuf/timestamp.rb | 127 ++ .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 ++ .../google-cloud-batch-v1/snippets/Gemfile | 32 + .../snippets/batch_service/create_job.rb | 47 + .../snippets/batch_service/delete_job.rb | 54 + .../snippets/batch_service/get_job.rb | 47 + .../snippets/batch_service/get_task.rb | 47 + .../snippets/batch_service/list_jobs.rb | 51 + .../snippets/batch_service/list_tasks.rb | 51 + .../snippets/iam_policy/get_iam_policy.rb | 47 + .../snippets/iam_policy/set_iam_policy.rb | 47 + .../iam_policy/test_iam_permissions.rb | 47 + ...nippet_metadata_google.cloud.batch.v1.json | 255 ++++ .../snippet_metadata_google.iam.v1.json | 135 +++ .../batch/v1/batch_service_operations_test.rb | 389 +++++++ .../batch/v1/batch_service_paths_test.rb | 83 ++ .../cloud/batch/v1/batch_service_rest_test.rb | 427 +++++++ .../cloud/batch/v1/batch_service_test.rb | 477 ++++++++ .../google/iam/v1/iam_policy_rest_test.rb | 257 +++++ .../test/google/iam/v1/iam_policy_test.rb | 258 +++++ .../google-cloud-batch-v1/test/helper.rb | 25 + 81 files changed, 14448 insertions(+) create mode 100644 owl-bot-staging/google-cloud-batch-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-batch-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-batch-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-batch-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-batch-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-batch-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-batch-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-batch-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-batch-v1/README.md create mode 100644 owl-bot-staging/google-cloud-batch-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-batch-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-batch-v1/google-cloud-batch-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google-cloud-batch-v1.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_pb.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/client.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/job_pb.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/task_pb.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/volume_pb.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/client.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/credentials.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/batch.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/job.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/task.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/volume.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/create_job.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/delete_job.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/get_job.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/get_task.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/list_jobs.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/list_tasks.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/snippet_metadata_google.cloud.batch.v1.json create mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/snippet_metadata_google.iam.v1.json create mode 100644 owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_test.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/test/google/iam/v1/iam_policy_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/test/google/iam/v1/iam_policy_test.rb create mode 100644 owl-bot-staging/google-cloud-batch-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-batch-v1/.gitignore b/owl-bot-staging/google-cloud-batch-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-batch-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-batch-v1/.repo-metadata.json new file mode 100644 index 000000000000..e36027edffb2 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "api_id": "batch.googleapis.com", + "api_shortname": "batch", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest", + "distribution_name": "google-cloud-batch-v1", + "is_cloud": true, + "language": "ruby", + "name": "batch", + "name_pretty": "Batch V1 API", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Google Cloud Batch is a fully managed service used by scientists, VFX artists, developers to easily and efficiently run batch workloads on Google Cloud. This service manages provisioning of resources to satisfy the requirements of the batch jobs for a variety of workloads including ML, HPC, VFX rendering, transcoding, genomics and others. Note that google-cloud-batch-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-batch instead. See the readme for more details.", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-batch-v1/.rubocop.yml b/owl-bot-staging/google-cloud-batch-v1/.rubocop.yml new file mode 100644 index 000000000000..dfe88aff925c --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-batch-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-batch-v1.rb" diff --git a/owl-bot-staging/google-cloud-batch-v1/.toys.rb b/owl-bot-staging/google-cloud-batch-v1/.toys.rb new file mode 100644 index 000000000000..23434bdd5d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-batch-v1/.yardopts b/owl-bot-staging/google-cloud-batch-v1/.yardopts new file mode 100644 index 000000000000..5628edd53225 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Batch V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-batch-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-batch-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..08e3de31e49e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-batch-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-batch-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/batch/v1" + +client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/batch/v1" + +::Google::Cloud::Batch::V1::BatchService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Batch::V1::BatchService::Client.new +``` + +### Environment Variables + +You can also use an environment variable to provide a JSON credentials file. +The environment variable can contain a path to the credentials file or, for +environments such as Docker containers where writing files is not encouraged, +you can include the credentials file itself. + +The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +The environment variables that google-cloud-batch-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/batch/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Batch::V1::BatchService::Client.new +``` + +### Local ADC file + +You can set up a local ADC file with your user credentials for authentication during +development. If credentials are not provided in code or in environment variables, +then the local ADC credentials are discovered. + +Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, credentials are retrieved from the attached +service account automatically. Code should be written as if already authenticated. + +For more information, see +[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-batch-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-batch-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-batch-v1/Gemfile b/owl-bot-staging/google-cloud-batch-v1/Gemfile new file mode 100644 index 000000000000..95163a6d11f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.27.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-batch-v1/LICENSE.md b/owl-bot-staging/google-cloud-batch-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-batch-v1/README.md b/owl-bot-staging/google-cloud-batch-v1/README.md new file mode 100644 index 000000000000..41d3f7a98da6 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/README.md @@ -0,0 +1,141 @@ +# Ruby Client for the Batch V1 API + +An API to manage the running of Batch resources on Google Cloud Platform. + +Google Cloud Batch is a fully managed service used by scientists, VFX artists, developers to easily and efficiently run batch workloads on Google Cloud. This service manages provisioning of resources to satisfy the requirements of the batch jobs for a variety of workloads including ML, HPC, VFX rendering, transcoding, genomics and others. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Batch V1 API. Most users should consider using +the main client gem, +[google-cloud-batch](https://rubygems.org/gems/google-cloud-batch). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-batch-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/batch.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/batch/v1" + +client = ::Google::Cloud::Batch::V1::BatchService::Client.new +request = ::Google::Cloud::Batch::V1::CreateJobRequest.new # (request fields as keyword arguments...) +response = client.create_job request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest) +for class and method documentation. + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) +that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 2.7+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-batch`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-batch-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-batch`. +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-batch-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-batch-v1/Rakefile b/owl-bot-staging/google-cloud-batch-v1/Rakefile new file mode 100644 index 000000000000..bad6d91c4090 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = false +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +# Acceptance tests +desc "Run the google-cloud-batch-v1 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/batch/v1/batch_service/credentials" + ::Google::Cloud::Batch::V1::BatchService::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-batch-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-batch-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-batch-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-batch-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-batch-v1" + header "google-cloud-batch-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-batch-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-batch-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-batch-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-batch-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-batch-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-batch-v1/gapic_metadata.json new file mode 100644 index 000000000000..a4cb50eded13 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/gapic_metadata.json @@ -0,0 +1,48 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.batch.v1", + "libraryPackage": "::Google::Cloud::Batch::V1", + "services": { + "BatchService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Batch::V1::BatchService::Client", + "rpcs": { + "CreateJob": { + "methods": [ + "create_job" + ] + }, + "GetJob": { + "methods": [ + "get_job" + ] + }, + "DeleteJob": { + "methods": [ + "delete_job" + ] + }, + "ListJobs": { + "methods": [ + "list_jobs" + ] + }, + "GetTask": { + "methods": [ + "get_task" + ] + }, + "ListTasks": { + "methods": [ + "list_tasks" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-batch-v1/google-cloud-batch-v1.gemspec b/owl-bot-staging/google-cloud-batch-v1/google-cloud-batch-v1.gemspec new file mode 100644 index 000000000000..f411e4de702e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/google-cloud-batch-v1.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/batch/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-batch-v1" + gem.version = Google::Cloud::Batch::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Google Cloud Batch is a fully managed service used by scientists, VFX artists, developers to easily and efficiently run batch workloads on Google Cloud. This service manages provisioning of resources to satisfy the requirements of the batch jobs for a variety of workloads including ML, HPC, VFX rendering, transcoding, genomics and others. Note that google-cloud-batch-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-batch instead. See the readme for more details." + gem.summary = "An API to manage the running of Batch resources on Google Cloud Platform." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 2.7" + + gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" + gem.add_dependency "grpc-google-iam-v1", "~> 1.1" +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google-cloud-batch-v1.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google-cloud-batch-v1.rb new file mode 100644 index 000000000000..5ba63ef2b1ba --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google-cloud-batch-v1.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# This gem does not autoload during Bundler.require. To load this gem, +# issue explicit require statements for the packages desired, e.g.: +# require "google/cloud/batch/v1" +# require "google/iam/v1" diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1.rb new file mode 100644 index 000000000000..1d39572863b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/batch/v1/batch_service" +require "google/cloud/batch/v1/version" + +module Google + module Cloud + module Batch + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/batch/v1" + # client = ::Google::Cloud::Batch::V1::BatchService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/batch/v1" + # client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/batch/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_pb.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_pb.rb new file mode 100644 index 000000000000..d1621fb84219 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_pb.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/batch/v1/batch.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/cloud/batch/v1/job_pb' +require 'google/cloud/batch/v1/task_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n!google/cloud/batch/v1/batch.proto\x12\x15google.cloud.batch.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/cloud/batch/v1/job.proto\x1a google/cloud/batch/v1/task.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9b\x01\n\x10\x43reateJobRequest\x12\x30\n\x06parent\x18\x01 \x01(\tB \xe0\x41\x02\xfa\x41\x1a\x12\x18\x62\x61tch.googleapis.com/Job\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12,\n\x03job\x18\x03 \x01(\x0b\x32\x1a.google.cloud.batch.v1.JobB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"?\n\rGetJobRequest\x12.\n\x04name\x18\x01 \x01(\tB \xe0\x41\x02\xfa\x41\x1a\n\x18\x62\x61tch.googleapis.com/Job\"N\n\x10\x44\x65leteJobRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x06reason\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"o\n\x0fListJobsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"j\n\x10ListJobsResponse\x12(\n\x04jobs\x18\x01 \x03(\x0b\x32\x1a.google.cloud.batch.v1.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x81\x01\n\x10ListTasksRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x62\x61tch.googleapis.com/TaskGroup\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"m\n\x11ListTasksResponse\x12*\n\x05tasks\x18\x01 \x03(\x0b\x32\x1b.google.cloud.batch.v1.Task\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"A\n\x0eGetTaskRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x62\x61tch.googleapis.com/Task\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x32\xb6\x08\n\x0c\x42\x61tchService\x12\x9b\x01\n\tCreateJob\x12\'.google.cloud.batch.v1.CreateJobRequest\x1a\x1a.google.cloud.batch.v1.Job\"I\xda\x41\x11parent,job,job_id\x82\xd3\xe4\x93\x02/\"(/v1/{parent=projects/*/locations/*}/jobs:\x03job\x12\x83\x01\n\x06GetJob\x12$.google.cloud.batch.v1.GetJobRequest\x1a\x1a.google.cloud.batch.v1.Job\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v1/{name=projects/*/locations/*/jobs/*}\x12\xcf\x01\n\tDeleteJob\x12\'.google.cloud.batch.v1.DeleteJobRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41@\n\x15google.protobuf.Empty\x12\'google.cloud.batch.v1.OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02**(/v1/{name=projects/*/locations/*/jobs/*}\x12\x96\x01\n\x08ListJobs\x12&.google.cloud.batch.v1.ListJobsRequest\x1a\'.google.cloud.batch.v1.ListJobsResponse\"9\xda\x41\x06parent\x82\xd3\xe4\x93\x02*\x12(/v1/{parent=projects/*/locations/*}/jobs\x12\x9b\x01\n\x07GetTask\x12%.google.cloud.batch.v1.GetTaskRequest\x1a\x1b.google.cloud.batch.v1.Task\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}\x12\xae\x01\n\tListTasks\x12\'.google.cloud.batch.v1.ListTasksRequest\x1a(.google.cloud.batch.v1.ListTasksResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks\x1aH\xca\x41\x14\x62\x61tch.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xab\x01\n\x19\x63om.google.cloud.batch.v1B\nBatchProtoP\x01Z/cloud.google.com/go/batch/apiv1/batchpb;batchpb\xa2\x02\x03GCB\xaa\x02\x15Google.Cloud.Batch.V1\xca\x02\x15Google\\Cloud\\Batch\\V1\xea\x02\x18Google::Cloud::Batch::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.cloud.batch.v1.Job", "google/cloud/batch/v1/job.proto"], + ["google.cloud.batch.v1.Task", "google/cloud/batch/v1/task.proto"], + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Batch + module V1 + CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.CreateJobRequest").msgclass + GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.GetJobRequest").msgclass + DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.DeleteJobRequest").msgclass + ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.ListJobsRequest").msgclass + ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.ListJobsResponse").msgclass + ListTasksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.ListTasksRequest").msgclass + ListTasksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.ListTasksResponse").msgclass + GetTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.GetTaskRequest").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.OperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service.rb new file mode 100644 index 000000000000..0a5b1d2ce724 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/batch/v1/version" + +require "google/cloud/batch/v1/batch_service/credentials" +require "google/cloud/batch/v1/batch_service/paths" +require "google/cloud/batch/v1/batch_service/operations" +require "google/cloud/batch/v1/batch_service/client" +require "google/cloud/batch/v1/batch_service/rest" + +module Google + module Cloud + module Batch + module V1 + ## + # Google Batch Service. + # The service manages user submitted batch jobs and allocates Google Compute + # Engine VM instances to run the jobs. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/batch/v1/batch_service" + # client = ::Google::Cloud::Batch::V1::BatchService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/batch/v1/batch_service/rest" + # client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new + # + module BatchService + end + end + end + end +end + +helper_path = ::File.join __dir__, "batch_service", "helpers.rb" +require "google/cloud/batch/v1/batch_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/client.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/client.rb new file mode 100644 index 000000000000..a5c2ebac0ab1 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/client.rb @@ -0,0 +1,1025 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/batch/v1/batch_pb" +require "google/cloud/location" + +module Google + module Cloud + module Batch + module V1 + module BatchService + ## + # Client for the BatchService service. + # + # Google Batch Service. + # The service manages user submitted batch jobs and allocates Google Compute + # Engine VM instances to run the jobs. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "batch.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :batch_service_stub + + ## + # Configure the BatchService Client class. + # + # See {::Google::Cloud::Batch::V1::BatchService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all BatchService clients + # ::Google::Cloud::Batch::V1::BatchService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Batch", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_job.timeout = 60.0 + + default_config.rpcs.get_job.timeout = 60.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_job.timeout = 60.0 + + default_config.rpcs.list_jobs.timeout = 60.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_task.timeout = 60.0 + default_config.rpcs.get_task.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_tasks.timeout = 60.0 + default_config.rpcs.list_tasks.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the BatchService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Batch::V1::BatchService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @batch_service_stub.universe_domain + end + + ## + # Create a new BatchService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Batch::V1::BatchService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the BatchService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/batch/v1/batch_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @batch_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Batch::V1::BatchService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @batch_service_stub.endpoint + config.universe_domain = @batch_service_stub.universe_domain + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Batch::V1::BatchService::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + # Service calls + + ## + # Create a Job. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::Batch::V1::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Batch::V1::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_job(parent: nil, job_id: nil, job: nil, request_id: nil) + # Pass arguments to `create_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name where the Job will be created. + # Pattern: "projects/\\{project}/locations/\\{location}" + # @param job_id [::String] + # ID used to uniquely identify the Job within its parent scope. + # This field should contain at most 63 characters and must start with + # lowercase characters. + # Only lowercase characters, numbers and '-' are accepted. + # The '-' character cannot be the first or the last one. + # A system generated ID will be used if the field is not set. + # + # The job.name field in the request will be ignored and the created resource + # name of the Job will be "\\{parent}/jobs/\\{job_id}". + # @param job [::Google::Cloud::Batch::V1::Job, ::Hash] + # Required. The Job to create. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Batch::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Batch::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/batch/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Batch::V1::BatchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Batch::V1::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Google::Cloud::Batch::V1::Job. + # p result + # + def create_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::CreateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_service_stub.call_rpc :create_job, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a Job specified by its resource name. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Batch::V1::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Batch::V1::GetJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_job(name: nil) + # Pass arguments to `get_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Job name. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Batch::V1::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Batch::V1::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/batch/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Batch::V1::BatchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Batch::V1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Batch::V1::Job. + # p result + # + def get_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::GetJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_service_stub.call_rpc :get_job, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Delete a Job. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Batch::V1::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Batch::V1::DeleteJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_job(name: nil, reason: nil, request_id: nil) + # Pass arguments to `delete_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Job name. + # @param reason [::String] + # Optional. Reason for this deletion. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/batch/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Batch::V1::BatchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Batch::V1::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::DeleteJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_service_stub.call_rpc :delete_job, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List all Jobs for a project within a region. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Batch::V1::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Batch::V1::ListJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_jobs(parent: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Parent path. + # @param filter [::String] + # List filter. + # @param order_by [::String] + # Optional. Sort results. Supported are "name", "name desc", "create_time", + # and "create_time desc". + # @param page_size [::Integer] + # Page size. + # @param page_token [::String] + # Page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Batch::V1::Job>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Batch::V1::Job>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/batch/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Batch::V1::BatchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Batch::V1::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Batch::V1::Job. + # p item + # end + # + def list_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::ListJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_service_stub.call_rpc :list_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @batch_service_stub, :list_jobs, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Return a single Task. + # + # @overload get_task(request, options = nil) + # Pass arguments to `get_task` via a request object, either of type + # {::Google::Cloud::Batch::V1::GetTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Batch::V1::GetTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_task(name: nil) + # Pass arguments to `get_task` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Task name. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Batch::V1::Task] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Batch::V1::Task] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/batch/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Batch::V1::BatchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Batch::V1::GetTaskRequest.new + # + # # Call the get_task method. + # result = client.get_task request + # + # # The returned object is of type Google::Cloud::Batch::V1::Task. + # p result + # + def get_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::GetTaskRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_task.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_service_stub.call_rpc :get_task, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List Tasks associated with a job. + # + # @overload list_tasks(request, options = nil) + # Pass arguments to `list_tasks` via a request object, either of type + # {::Google::Cloud::Batch::V1::ListTasksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Batch::V1::ListTasksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_tasks(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tasks` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of a TaskGroup from which Tasks are being requested. + # Pattern: + # "projects/\\{project}/locations/\\{location}/jobs/\\{job}/taskGroups/\\{task_group}" + # @param filter [::String] + # Task filter, null filter matches all Tasks. + # Filter string should be of the format State=TaskStatus.State e.g. + # State=RUNNING + # @param page_size [::Integer] + # Page size. + # @param page_token [::String] + # Page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Batch::V1::Task>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Batch::V1::Task>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/batch/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Batch::V1::BatchService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Batch::V1::ListTasksRequest.new + # + # # Call the list_tasks method. + # result = client.list_tasks request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Batch::V1::Task. + # p item + # end + # + def list_tasks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::ListTasksRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_tasks.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_tasks.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tasks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_service_stub.call_rpc :list_tasks, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @batch_service_stub, :list_tasks, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the BatchService API. + # + # This class represents the configuration for BatchService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Batch::V1::BatchService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Batch::V1::BatchService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_job.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "batch.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the BatchService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `list_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `get_task` + # @return [::Gapic::Config::Method] + # + attr_reader :get_task + ## + # RPC-specific configuration for `list_tasks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tasks + + # @private + def initialize parent_rpcs = nil + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task + @get_task = ::Gapic::Config::Method.new get_task_config + list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks + @list_tasks = ::Gapic::Config::Method.new list_tasks_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/credentials.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/credentials.rb new file mode 100644 index 000000000000..0b8add596020 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Batch + module V1 + module BatchService + # Credentials for the BatchService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/operations.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/operations.rb new file mode 100644 index 000000000000..2a79186dff2e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/operations.rb @@ -0,0 +1,809 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Batch + module V1 + module BatchService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "batch.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the BatchService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the BatchService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "batch.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/paths.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/paths.rb new file mode 100644 index 000000000000..e614ad8cad43 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/paths.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Batch + module V1 + module BatchService + # Path helper methods for the BatchService API. + module Paths + ## + # Create a fully-qualified Job resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/jobs/{job}` + # + # @param project [String] + # @param location [String] + # @param job [String] + # + # @return [::String] + def job_path project:, location:, job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/jobs/#{job}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Task resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}` + # + # @param project [String] + # @param location [String] + # @param job [String] + # @param task_group [String] + # @param task [String] + # + # @return [::String] + def task_path project:, location:, job:, task_group:, task: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "job cannot contain /" if job.to_s.include? "/" + raise ::ArgumentError, "task_group cannot contain /" if task_group.to_s.include? "/" + + "projects/#{project}/locations/#{location}/jobs/#{job}/taskGroups/#{task_group}/tasks/#{task}" + end + + ## + # Create a fully-qualified TaskGroup resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}` + # + # @param project [String] + # @param location [String] + # @param job [String] + # @param task_group [String] + # + # @return [::String] + def task_group_path project:, location:, job:, task_group: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "job cannot contain /" if job.to_s.include? "/" + + "projects/#{project}/locations/#{location}/jobs/#{job}/taskGroups/#{task_group}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest.rb new file mode 100644 index 000000000000..90f47cda85b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/batch/v1/version" +require "google/cloud/batch/v1/bindings_override" + +require "google/cloud/batch/v1/batch_service/credentials" +require "google/cloud/batch/v1/batch_service/paths" +require "google/cloud/batch/v1/batch_service/rest/operations" +require "google/cloud/batch/v1/batch_service/rest/client" + +module Google + module Cloud + module Batch + module V1 + ## + # Google Batch Service. + # The service manages user submitted batch jobs and allocates Google Compute + # Engine VM instances to run the jobs. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/batch/v1/batch_service/rest" + # client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new + # + module BatchService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/batch/v1/batch_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/client.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/client.rb new file mode 100644 index 000000000000..e034de34410b --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/client.rb @@ -0,0 +1,963 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/batch/v1/batch_pb" +require "google/cloud/batch/v1/batch_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Batch + module V1 + module BatchService + module Rest + ## + # REST client for the BatchService service. + # + # Google Batch Service. + # The service manages user submitted batch jobs and allocates Google Compute + # Engine VM instances to run the jobs. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "batch.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :batch_service_stub + + ## + # Configure the BatchService Client class. + # + # See {::Google::Cloud::Batch::V1::BatchService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all BatchService clients + # ::Google::Cloud::Batch::V1::BatchService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Batch", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_job.timeout = 60.0 + + default_config.rpcs.get_job.timeout = 60.0 + default_config.rpcs.get_job.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_job.timeout = 60.0 + + default_config.rpcs.list_jobs.timeout = 60.0 + default_config.rpcs.list_jobs.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_task.timeout = 60.0 + default_config.rpcs.get_task.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_tasks.timeout = 60.0 + default_config.rpcs.list_tasks.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the BatchService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Batch::V1::BatchService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @batch_service_stub.universe_domain + end + + ## + # Create a new BatchService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the BatchService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Cloud::Batch::V1::BatchService::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @batch_service_stub = ::Google::Cloud::Batch::V1::BatchService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @batch_service_stub.endpoint + config.universe_domain = @batch_service_stub.universe_domain + config.bindings_override = @config.bindings_override + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Batch::V1::BatchService::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + # Service calls + + ## + # Create a Job. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::Batch::V1::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Batch::V1::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload create_job(parent: nil, job_id: nil, job: nil, request_id: nil) + # Pass arguments to `create_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource name where the Job will be created. + # Pattern: "projects/\\{project}/locations/\\{location}" + # @param job_id [::String] + # ID used to uniquely identify the Job within its parent scope. + # This field should contain at most 63 characters and must start with + # lowercase characters. + # Only lowercase characters, numbers and '-' are accepted. + # The '-' character cannot be the first or the last one. + # A system generated ID will be used if the field is not set. + # + # The job.name field in the request will be ignored and the created resource + # name of the Job will be "\\{parent}/jobs/\\{job_id}". + # @param job [::Google::Cloud::Batch::V1::Job, ::Hash] + # Required. The Job to create. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Batch::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Batch::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/batch/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Batch::V1::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Google::Cloud::Batch::V1::Job. + # p result + # + def create_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::CreateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_service_stub.create_job request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Get a Job specified by its resource name. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Batch::V1::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Batch::V1::GetJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_job(name: nil) + # Pass arguments to `get_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Job name. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Batch::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Batch::V1::Job] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/batch/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Batch::V1::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Batch::V1::Job. + # p result + # + def get_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::GetJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_service_stub.get_job request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Delete a Job. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Batch::V1::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Batch::V1::DeleteJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_job(name: nil, reason: nil, request_id: nil) + # Pass arguments to `delete_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Job name. + # @param reason [::String] + # Optional. Reason for this deletion. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/batch/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Batch::V1::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::DeleteJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_job.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_service_stub.delete_job request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List all Jobs for a project within a region. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Batch::V1::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Batch::V1::ListJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_jobs(parent: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Parent path. + # @param filter [::String] + # List filter. + # @param order_by [::String] + # Optional. Sort results. Supported are "name", "name desc", "create_time", + # and "create_time desc". + # @param page_size [::Integer] + # Page size. + # @param page_token [::String] + # Page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Batch::V1::ListJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Batch::V1::ListJobsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/batch/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Batch::V1::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Batch::V1::Job. + # p item + # end + # + def list_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::ListJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_jobs.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_service_stub.list_jobs request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Return a single Task. + # + # @overload get_task(request, options = nil) + # Pass arguments to `get_task` via a request object, either of type + # {::Google::Cloud::Batch::V1::GetTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Batch::V1::GetTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_task(name: nil) + # Pass arguments to `get_task` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Task name. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Batch::V1::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Batch::V1::Task] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/batch/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Batch::V1::GetTaskRequest.new + # + # # Call the get_task method. + # result = client.get_task request + # + # # The returned object is of type Google::Cloud::Batch::V1::Task. + # p result + # + def get_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::GetTaskRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_task.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_task.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_service_stub.get_task request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # List Tasks associated with a job. + # + # @overload list_tasks(request, options = nil) + # Pass arguments to `list_tasks` via a request object, either of type + # {::Google::Cloud::Batch::V1::ListTasksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Batch::V1::ListTasksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_tasks(parent: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_tasks` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. Name of a TaskGroup from which Tasks are being requested. + # Pattern: + # "projects/\\{project}/locations/\\{location}/jobs/\\{job}/taskGroups/\\{task_group}" + # @param filter [::String] + # Task filter, null filter matches all Tasks. + # Filter string should be of the format State=TaskStatus.State e.g. + # State=RUNNING + # @param page_size [::Integer] + # Page size. + # @param page_token [::String] + # Page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Batch::V1::ListTasksResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Batch::V1::ListTasksResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/batch/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Batch::V1::ListTasksRequest.new + # + # # Call the list_tasks method. + # result = client.list_tasks request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Cloud::Batch::V1::Task. + # p item + # end + # + def list_tasks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::ListTasksRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_tasks.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_tasks.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_tasks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @batch_service_stub.list_tasks request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the BatchService REST API. + # + # This class represents the configuration for BatchService REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Batch::V1::BatchService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Batch::V1::BatchService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_job.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "batch.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the BatchService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `list_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `get_task` + # @return [::Gapic::Config::Method] + # + attr_reader :get_task + ## + # RPC-specific configuration for `list_tasks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tasks + + # @private + def initialize parent_rpcs = nil + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task + @get_task = ::Gapic::Config::Method.new get_task_config + list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks + @list_tasks = ::Gapic::Config::Method.new list_tasks_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/operations.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/operations.rb new file mode 100644 index 000000000000..8a8162342516 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/operations.rb @@ -0,0 +1,902 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Cloud + module Batch + module V1 + module BatchService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "batch.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the BatchService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the BatchService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "batch.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/service_stub.rb new file mode 100644 index 000000000000..1f1ddd8e63bc --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/service_stub.rb @@ -0,0 +1,424 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/batch/v1/batch_pb" + +module Google + module Cloud + module Batch + module V1 + module BatchService + module Rest + ## + # REST service stub for the BatchService service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # Baseline implementation for the create_job REST call + # + # @param request_pb [::Google::Cloud::Batch::V1::CreateJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Batch::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Batch::V1::Job] + # A result object deserialized from the server's reply + def create_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Batch::V1::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_job REST call + # + # @param request_pb [::Google::Cloud::Batch::V1::GetJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Batch::V1::Job] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Batch::V1::Job] + # A result object deserialized from the server's reply + def get_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Batch::V1::Job.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the delete_job REST call + # + # @param request_pb [::Google::Cloud::Batch::V1::DeleteJobRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_job_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_jobs REST call + # + # @param request_pb [::Google::Cloud::Batch::V1::ListJobsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Batch::V1::ListJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Batch::V1::ListJobsResponse] + # A result object deserialized from the server's reply + def list_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_jobs_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Batch::V1::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_task REST call + # + # @param request_pb [::Google::Cloud::Batch::V1::GetTaskRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Batch::V1::Task] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Batch::V1::Task] + # A result object deserialized from the server's reply + def get_task request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_task_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Batch::V1::Task.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the list_tasks REST call + # + # @param request_pb [::Google::Cloud::Batch::V1::ListTasksRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Batch::V1::ListTasksResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Batch::V1::ListTasksResponse] + # A result object deserialized from the server's reply + def list_tasks request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_tasks_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Batch::V1::ListTasksResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the create_job REST call + # + # @param request_pb [::Google::Cloud::Batch::V1::CreateJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/jobs", + body: "job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_job REST call + # + # @param request_pb [::Google::Cloud::Batch::V1::GetJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_job REST call + # + # @param request_pb [::Google::Cloud::Batch::V1::DeleteJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_jobs REST call + # + # @param request_pb [::Google::Cloud::Batch::V1::ListJobsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/jobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_task REST call + # + # @param request_pb [::Google::Cloud::Batch::V1::GetTaskRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_task_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/taskGroups/[^/]+/tasks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_tasks REST call + # + # @param request_pb [::Google::Cloud::Batch::V1::ListTasksRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_tasks_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/tasks", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/taskGroups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_services_pb.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_services_pb.rb new file mode 100644 index 000000000000..917796b2dc99 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_services_pb.rb @@ -0,0 +1,57 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/batch/v1/batch.proto for package 'Google.Cloud.Batch.V1' +# Original file comments: +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/batch/v1/batch_pb' + +module Google + module Cloud + module Batch + module V1 + module BatchService + # Google Batch Service. + # The service manages user submitted batch jobs and allocates Google Compute + # Engine VM instances to run the jobs. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.batch.v1.BatchService' + + # Create a Job. + rpc :CreateJob, ::Google::Cloud::Batch::V1::CreateJobRequest, ::Google::Cloud::Batch::V1::Job + # Get a Job specified by its resource name. + rpc :GetJob, ::Google::Cloud::Batch::V1::GetJobRequest, ::Google::Cloud::Batch::V1::Job + # Delete a Job. + rpc :DeleteJob, ::Google::Cloud::Batch::V1::DeleteJobRequest, ::Google::Longrunning::Operation + # List all Jobs for a project within a region. + rpc :ListJobs, ::Google::Cloud::Batch::V1::ListJobsRequest, ::Google::Cloud::Batch::V1::ListJobsResponse + # Return a single Task. + rpc :GetTask, ::Google::Cloud::Batch::V1::GetTaskRequest, ::Google::Cloud::Batch::V1::Task + # List Tasks associated with a job. + rpc :ListTasks, ::Google::Cloud::Batch::V1::ListTasksRequest, ::Google::Cloud::Batch::V1::ListTasksResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/bindings_override.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/bindings_override.rb new file mode 100644 index 000000000000..962245c1b9f9 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/bindings_override.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/config" + +module Google + module Cloud + module Batch + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/batch/v1/rest" + # client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Batch"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = Configuration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + + ## + # @private + # Configuration class for the google.cloud.batch.v1 package. + # + # This class contains common configuration for all services + # of the google.cloud.batch.v1 package. + # + # This configuration is for internal use of the client library classes, + # and it is not intended that the end-users will read or change it. + # + class Configuration + extend ::Gapic::Config + + # @private + # Overrides for http bindings for the RPC of the mixins for this package. + # Services in this package should use these when creating clients for the mixin services. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/job_pb.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/job_pb.rb new file mode 100644 index 000000000000..c9cc28e4b26b --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/job_pb.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/batch/v1/job.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/batch/v1/task_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n\x1fgoogle/cloud/batch/v1/job.proto\x12\x15google.cloud.batch.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/cloud/batch/v1/task.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x90\x05\n\x03Job\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x08priority\x18\x03 \x01(\x03\x12:\n\x0btask_groups\x18\x04 \x03(\x0b\x32 .google.cloud.batch.v1.TaskGroupB\x03\xe0\x41\x02\x12\x42\n\x11\x61llocation_policy\x18\x07 \x01(\x0b\x32\'.google.cloud.batch.v1.AllocationPolicy\x12\x36\n\x06labels\x18\x08 \x03(\x0b\x32&.google.cloud.batch.v1.Job.LabelsEntry\x12\x35\n\x06status\x18\t \x01(\x0b\x32 .google.cloud.batch.v1.JobStatusB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\x0blogs_policy\x18\r \x01(\x0b\x32!.google.cloud.batch.v1.LogsPolicy\x12=\n\rnotifications\x18\x0e \x03(\x0b\x32&.google.cloud.batch.v1.JobNotification\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:Q\xea\x41N\n\x18\x62\x61tch.googleapis.com/Job\x12\x32projects/{project}/locations/{location}/jobs/{job}\"\xcd\x02\n\nLogsPolicy\x12\x42\n\x0b\x64\x65stination\x18\x01 \x01(\x0e\x32-.google.cloud.batch.v1.LogsPolicy.Destination\x12\x11\n\tlogs_path\x18\x02 \x01(\t\x12W\n\x14\x63loud_logging_option\x18\x03 \x01(\x0b\x32\x34.google.cloud.batch.v1.LogsPolicy.CloudLoggingOptionB\x03\xe0\x41\x01\x1a\x46\n\x12\x43loudLoggingOption\x12\x30\n#use_generic_task_monitored_resource\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"G\n\x0b\x44\x65stination\x12\x1b\n\x17\x44\x45STINATION_UNSPECIFIED\x10\x00\x12\x11\n\rCLOUD_LOGGING\x10\x01\x12\x08\n\x04PATH\x10\x02\"\x80\x07\n\tJobStatus\x12\x35\n\x05state\x18\x01 \x01(\x0e\x32&.google.cloud.batch.v1.JobStatus.State\x12\x39\n\rstatus_events\x18\x02 \x03(\x0b\x32\".google.cloud.batch.v1.StatusEvent\x12\x45\n\x0btask_groups\x18\x04 \x03(\x0b\x32\x30.google.cloud.batch.v1.JobStatus.TaskGroupsEntry\x12/\n\x0crun_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\xd1\x01\n\x0eInstanceStatus\x12\x14\n\x0cmachine_type\x18\x01 \x01(\t\x12U\n\x12provisioning_model\x18\x02 \x01(\x0e\x32\x39.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel\x12\x11\n\ttask_pack\x18\x03 \x01(\x03\x12?\n\tboot_disk\x18\x04 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.Disk\x1a\xd2\x01\n\x0fTaskGroupStatus\x12L\n\x06\x63ounts\x18\x01 \x03(\x0b\x32<.google.cloud.batch.v1.JobStatus.TaskGroupStatus.CountsEntry\x12\x42\n\tinstances\x18\x02 \x03(\x0b\x32/.google.cloud.batch.v1.JobStatus.InstanceStatus\x1a-\n\x0b\x43ountsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x63\n\x0fTaskGroupsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.google.cloud.batch.v1.JobStatus.TaskGroupStatus:\x02\x38\x01\"{\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06QUEUED\x10\x01\x12\r\n\tSCHEDULED\x10\x02\x12\x0b\n\x07RUNNING\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05\x12\x18\n\x14\x44\x45LETION_IN_PROGRESS\x10\x06\"\xfc\x02\n\x0fJobNotification\x12\x14\n\x0cpubsub_topic\x18\x01 \x01(\t\x12?\n\x07message\x18\x02 \x01(\x0b\x32..google.cloud.batch.v1.JobNotification.Message\x1a\xc4\x01\n\x07Message\x12\x39\n\x04type\x18\x01 \x01(\x0e\x32+.google.cloud.batch.v1.JobNotification.Type\x12=\n\rnew_job_state\x18\x02 \x01(\x0e\x32&.google.cloud.batch.v1.JobStatus.State\x12?\n\x0enew_task_state\x18\x03 \x01(\x0e\x32\'.google.cloud.batch.v1.TaskStatus.State\"K\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11JOB_STATE_CHANGED\x10\x01\x12\x16\n\x12TASK_STATE_CHANGED\x10\x02\"\x81\x0f\n\x10\x41llocationPolicy\x12H\n\x08location\x18\x01 \x01(\x0b\x32\x36.google.cloud.batch.v1.AllocationPolicy.LocationPolicy\x12S\n\tinstances\x18\x08 \x03(\x0b\x32@.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate\x12>\n\x0fservice_account\x18\t \x01(\x0b\x32%.google.cloud.batch.v1.ServiceAccount\x12\x43\n\x06labels\x18\x06 \x03(\x0b\x32\x33.google.cloud.batch.v1.AllocationPolicy.LabelsEntry\x12\x46\n\x07network\x18\x07 \x01(\x0b\x32\x35.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy\x12J\n\tplacement\x18\n \x01(\x0b\x32\x37.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy\x12\x11\n\x04tags\x18\x0b \x03(\tB\x03\xe0\x41\x01\x1a+\n\x0eLocationPolicy\x12\x19\n\x11\x61llowed_locations\x18\x01 \x03(\t\x1aq\n\x04\x44isk\x12\x0f\n\x05image\x18\x04 \x01(\tH\x00\x12\x12\n\x08snapshot\x18\x05 \x01(\tH\x00\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07size_gb\x18\x02 \x01(\x03\x12\x16\n\x0e\x64isk_interface\x18\x06 \x01(\tB\r\n\x0b\x64\x61ta_source\x1a\x8a\x01\n\x0c\x41ttachedDisk\x12@\n\x08new_disk\x18\x01 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.DiskH\x00\x12\x17\n\rexisting_disk\x18\x02 \x01(\tH\x00\x12\x13\n\x0b\x64\x65vice_name\x18\x03 \x01(\tB\n\n\x08\x61ttached\x1ah\n\x0b\x41\x63\x63\x65lerator\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x03\x12\x1f\n\x13install_gpu_drivers\x18\x03 \x01(\x08\x42\x02\x18\x01\x12\x1b\n\x0e\x64river_version\x18\x04 \x01(\tB\x03\xe0\x41\x01\x1a\x82\x03\n\x0eInstancePolicy\x12\x14\n\x0cmachine_type\x18\x02 \x01(\t\x12\x18\n\x10min_cpu_platform\x18\x03 \x01(\t\x12U\n\x12provisioning_model\x18\x04 \x01(\x0e\x32\x39.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel\x12I\n\x0c\x61\x63\x63\x65lerators\x18\x05 \x03(\x0b\x32\x33.google.cloud.batch.v1.AllocationPolicy.Accelerator\x12?\n\tboot_disk\x18\x08 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.Disk\x12\x43\n\x05\x64isks\x18\x06 \x03(\x0b\x32\x34.google.cloud.batch.v1.AllocationPolicy.AttachedDisk\x12\x18\n\x0breservation\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\xf6\x01\n\x18InstancePolicyOrTemplate\x12H\n\x06policy\x18\x01 \x01(\x0b\x32\x36.google.cloud.batch.v1.AllocationPolicy.InstancePolicyH\x00\x12\x1b\n\x11instance_template\x18\x02 \x01(\tH\x00\x12\x1b\n\x13install_gpu_drivers\x18\x03 \x01(\x08\x12\x1e\n\x11install_ops_agent\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12#\n\x16\x62lock_project_ssh_keys\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x42\x11\n\x0fpolicy_template\x1aW\n\x10NetworkInterface\x12\x0f\n\x07network\x18\x01 \x01(\t\x12\x12\n\nsubnetwork\x18\x02 \x01(\t\x12\x1e\n\x16no_external_ip_address\x18\x03 \x01(\x08\x1a\x65\n\rNetworkPolicy\x12T\n\x12network_interfaces\x18\x01 \x03(\x0b\x32\x38.google.cloud.batch.v1.AllocationPolicy.NetworkInterface\x1a<\n\x0fPlacementPolicy\x12\x13\n\x0b\x63ollocation\x18\x01 \x01(\t\x12\x14\n\x0cmax_distance\x18\x02 \x01(\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"`\n\x11ProvisioningModel\x12\"\n\x1ePROVISIONING_MODEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x08\n\x04SPOT\x10\x02\x12\x0f\n\x0bPREEMPTIBLE\x10\x03\"\xcb\x04\n\tTaskGroup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x37\n\ttask_spec\x18\x03 \x01(\x0b\x32\x1f.google.cloud.batch.v1.TaskSpecB\x03\xe0\x41\x02\x12\x12\n\ntask_count\x18\x04 \x01(\x03\x12\x13\n\x0bparallelism\x18\x05 \x01(\x03\x12L\n\x11scheduling_policy\x18\x06 \x01(\x0e\x32\x31.google.cloud.batch.v1.TaskGroup.SchedulingPolicy\x12=\n\x11task_environments\x18\t \x03(\x0b\x32\".google.cloud.batch.v1.Environment\x12\x1b\n\x13task_count_per_node\x18\n \x01(\x03\x12\x1a\n\x12require_hosts_file\x18\x0b \x01(\x08\x12\x16\n\x0epermissive_ssh\x18\x0c \x01(\x08\x12\x1c\n\x0frun_as_non_root\x18\x0e \x01(\x08\x42\x03\xe0\x41\x01\"\\\n\x10SchedulingPolicy\x12!\n\x1dSCHEDULING_POLICY_UNSPECIFIED\x10\x00\x12\x17\n\x13\x41S_SOON_AS_POSSIBLE\x10\x01\x12\x0c\n\x08IN_ORDER\x10\x02:o\xea\x41l\n\x1e\x62\x61tch.googleapis.com/TaskGroup\x12Jprojects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}\"/\n\x0eServiceAccount\x12\r\n\x05\x65mail\x18\x01 \x01(\t\x12\x0e\n\x06scopes\x18\x02 \x03(\tB\xa9\x01\n\x19\x63om.google.cloud.batch.v1B\x08JobProtoP\x01Z/cloud.google.com/go/batch/apiv1/batchpb;batchpb\xa2\x02\x03GCB\xaa\x02\x15Google.Cloud.Batch.V1\xca\x02\x15Google\\Cloud\\Batch\\V1\xea\x02\x18Google::Cloud::Batch::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.cloud.batch.v1.StatusEvent", "google/cloud/batch/v1/task.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Batch + module V1 + Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Job").msgclass + LogsPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.LogsPolicy").msgclass + LogsPolicy::CloudLoggingOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.LogsPolicy.CloudLoggingOption").msgclass + LogsPolicy::Destination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.LogsPolicy.Destination").enummodule + JobStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.JobStatus").msgclass + JobStatus::InstanceStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.JobStatus.InstanceStatus").msgclass + JobStatus::TaskGroupStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.JobStatus.TaskGroupStatus").msgclass + JobStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.JobStatus.State").enummodule + JobNotification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.JobNotification").msgclass + JobNotification::Message = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.JobNotification.Message").msgclass + JobNotification::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.JobNotification.Type").enummodule + AllocationPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy").msgclass + AllocationPolicy::LocationPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.LocationPolicy").msgclass + AllocationPolicy::Disk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.Disk").msgclass + AllocationPolicy::AttachedDisk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.AttachedDisk").msgclass + AllocationPolicy::Accelerator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.Accelerator").msgclass + AllocationPolicy::InstancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.InstancePolicy").msgclass + AllocationPolicy::InstancePolicyOrTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate").msgclass + AllocationPolicy::NetworkInterface = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.NetworkInterface").msgclass + AllocationPolicy::NetworkPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.NetworkPolicy").msgclass + AllocationPolicy::PlacementPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.PlacementPolicy").msgclass + AllocationPolicy::ProvisioningModel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.ProvisioningModel").enummodule + TaskGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.TaskGroup").msgclass + TaskGroup::SchedulingPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.TaskGroup.SchedulingPolicy").enummodule + ServiceAccount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.ServiceAccount").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/rest.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/rest.rb new file mode 100644 index 000000000000..93079e00031b --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/batch/v1/batch_service/rest" +require "google/cloud/batch/v1/bindings_override" +require "google/cloud/batch/v1/version" + +module Google + module Cloud + module Batch + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/batch/v1/rest" + # client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/task_pb.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/task_pb.rb new file mode 100644 index 000000000000..2c30906e6c4d --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/task_pb.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/batch/v1/task.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/batch/v1/volume_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n google/cloud/batch/v1/task.proto\x12\x15google.cloud.batch.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\"google/cloud/batch/v1/volume.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"O\n\x0f\x43omputeResource\x12\x11\n\tcpu_milli\x18\x01 \x01(\x03\x12\x12\n\nmemory_mib\x18\x02 \x01(\x03\x12\x15\n\rboot_disk_mib\x18\x04 \x01(\x03\"\xdb\x01\n\x0bStatusEvent\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12.\n\nevent_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x0etask_execution\x18\x04 \x01(\x0b\x32$.google.cloud.batch.v1.TaskExecution\x12;\n\ntask_state\x18\x05 \x01(\x0e\x32\'.google.cloud.batch.v1.TaskStatus.State\"\"\n\rTaskExecution\x12\x11\n\texit_code\x18\x01 \x01(\x05\"\xf2\x01\n\nTaskStatus\x12\x36\n\x05state\x18\x01 \x01(\x0e\x32\'.google.cloud.batch.v1.TaskStatus.State\x12\x39\n\rstatus_events\x18\x02 \x03(\x0b\x32\".google.cloud.batch.v1.StatusEvent\"q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0c\n\x08\x41SSIGNED\x10\x02\x12\x0b\n\x07RUNNING\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\r\n\tSUCCEEDED\x10\x05\x12\x0e\n\nUNEXECUTED\x10\x06\"\x9e\x06\n\x08Runnable\x12>\n\tcontainer\x18\x01 \x01(\x0b\x32).google.cloud.batch.v1.Runnable.ContainerH\x00\x12\x38\n\x06script\x18\x02 \x01(\x0b\x32&.google.cloud.batch.v1.Runnable.ScriptH\x00\x12:\n\x07\x62\x61rrier\x18\x06 \x01(\x0b\x32\'.google.cloud.batch.v1.Runnable.BarrierH\x00\x12\x19\n\x0c\x64isplay_name\x18\n \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\x12ignore_exit_status\x18\x03 \x01(\x08\x12\x12\n\nbackground\x18\x04 \x01(\x08\x12\x12\n\nalways_run\x18\x05 \x01(\x08\x12\x37\n\x0b\x65nvironment\x18\x07 \x01(\x0b\x32\".google.cloud.batch.v1.Environment\x12*\n\x07timeout\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12;\n\x06labels\x18\t \x03(\x0b\x32+.google.cloud.batch.v1.Runnable.LabelsEntry\x1a\xcf\x01\n\tContainer\x12\x11\n\timage_uri\x18\x01 \x01(\t\x12\x10\n\x08\x63ommands\x18\x02 \x03(\t\x12\x12\n\nentrypoint\x18\x03 \x01(\t\x12\x0f\n\x07volumes\x18\x07 \x03(\t\x12\x0f\n\x07options\x18\x08 \x01(\t\x12\x1e\n\x16\x62lock_external_network\x18\t \x01(\x08\x12\x10\n\x08username\x18\n \x01(\t\x12\x10\n\x08password\x18\x0b \x01(\t\x12#\n\x16\x65nable_image_streaming\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x1a\x33\n\x06Script\x12\x0e\n\x04path\x18\x01 \x01(\tH\x00\x12\x0e\n\x04text\x18\x02 \x01(\tH\x00\x42\t\n\x07\x63ommand\x1a\x17\n\x07\x42\x61rrier\x12\x0c\n\x04name\x18\x01 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x0c\n\nexecutable\"\xfd\x03\n\x08TaskSpec\x12\x32\n\trunnables\x18\x08 \x03(\x0b\x32\x1f.google.cloud.batch.v1.Runnable\x12@\n\x10\x63ompute_resource\x18\x03 \x01(\x0b\x32&.google.cloud.batch.v1.ComputeResource\x12\x33\n\x10max_run_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x17\n\x0fmax_retry_count\x18\x05 \x01(\x05\x12\x42\n\x12lifecycle_policies\x18\t \x03(\x0b\x32&.google.cloud.batch.v1.LifecyclePolicy\x12K\n\x0c\x65nvironments\x18\x06 \x03(\x0b\x32\x31.google.cloud.batch.v1.TaskSpec.EnvironmentsEntryB\x02\x18\x01\x12.\n\x07volumes\x18\x07 \x03(\x0b\x32\x1d.google.cloud.batch.v1.Volume\x12\x37\n\x0b\x65nvironment\x18\n \x01(\x0b\x32\".google.cloud.batch.v1.Environment\x1a\x33\n\x11\x45nvironmentsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8a\x02\n\x0fLifecyclePolicy\x12=\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32-.google.cloud.batch.v1.LifecyclePolicy.Action\x12P\n\x10\x61\x63tion_condition\x18\x02 \x01(\x0b\x32\x36.google.cloud.batch.v1.LifecyclePolicy.ActionCondition\x1a%\n\x0f\x41\x63tionCondition\x12\x12\n\nexit_codes\x18\x01 \x03(\x05\"?\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\x0e\n\nRETRY_TASK\x10\x01\x12\r\n\tFAIL_TASK\x10\x02\"\xc0\x01\n\x04Task\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x31\n\x06status\x18\x02 \x01(\x0b\x32!.google.cloud.batch.v1.TaskStatus:w\xea\x41t\n\x19\x62\x61tch.googleapis.com/Task\x12Wprojects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}\"\x8f\x03\n\x0b\x45nvironment\x12\x44\n\tvariables\x18\x01 \x03(\x0b\x32\x31.google.cloud.batch.v1.Environment.VariablesEntry\x12Q\n\x10secret_variables\x18\x02 \x03(\x0b\x32\x37.google.cloud.batch.v1.Environment.SecretVariablesEntry\x12I\n\x13\x65ncrypted_variables\x18\x03 \x01(\x0b\x32,.google.cloud.batch.v1.Environment.KMSEnvMap\x1a\x32\n\tKMSEnvMap\x12\x10\n\x08key_name\x18\x01 \x01(\t\x12\x13\n\x0b\x63ipher_text\x18\x02 \x01(\t\x1a\x30\n\x0eVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x36\n\x14SecretVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\xaa\x01\n\x19\x63om.google.cloud.batch.v1B\tTaskProtoP\x01Z/cloud.google.com/go/batch/apiv1/batchpb;batchpb\xa2\x02\x03GCB\xaa\x02\x15Google.Cloud.Batch.V1\xca\x02\x15Google\\Cloud\\Batch\\V1\xea\x02\x18Google::Cloud::Batch::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], + ["google.protobuf.Duration", "google/protobuf/duration.proto"], + ["google.cloud.batch.v1.Volume", "google/cloud/batch/v1/volume.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Batch + module V1 + ComputeResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.ComputeResource").msgclass + StatusEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.StatusEvent").msgclass + TaskExecution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.TaskExecution").msgclass + TaskStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.TaskStatus").msgclass + TaskStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.TaskStatus.State").enummodule + Runnable = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Runnable").msgclass + Runnable::Container = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Runnable.Container").msgclass + Runnable::Script = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Runnable.Script").msgclass + Runnable::Barrier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Runnable.Barrier").msgclass + TaskSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.TaskSpec").msgclass + LifecyclePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.LifecyclePolicy").msgclass + LifecyclePolicy::ActionCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.LifecyclePolicy.ActionCondition").msgclass + LifecyclePolicy::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.LifecyclePolicy.Action").enummodule + Task = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Task").msgclass + Environment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Environment").msgclass + Environment::KMSEnvMap = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Environment.KMSEnvMap").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/version.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/version.rb new file mode 100644 index 000000000000..d4b9b7eae49d --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/version.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Batch + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/volume_pb.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/volume_pb.rb new file mode 100644 index 000000000000..abdf2ab5404e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/volume_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/batch/v1/volume.proto + +require 'google/protobuf' + + +descriptor_data = "\n\"google/cloud/batch/v1/volume.proto\x12\x15google.cloud.batch.v1\"\xaa\x01\n\x06Volume\x12)\n\x03nfs\x18\x01 \x01(\x0b\x32\x1a.google.cloud.batch.v1.NFSH\x00\x12)\n\x03gcs\x18\x03 \x01(\x0b\x32\x1a.google.cloud.batch.v1.GCSH\x00\x12\x15\n\x0b\x64\x65vice_name\x18\x06 \x01(\tH\x00\x12\x12\n\nmount_path\x18\x04 \x01(\t\x12\x15\n\rmount_options\x18\x05 \x03(\tB\x08\n\x06source\"*\n\x03NFS\x12\x0e\n\x06server\x18\x01 \x01(\t\x12\x13\n\x0bremote_path\x18\x02 \x01(\t\"\x1a\n\x03GCS\x12\x13\n\x0bremote_path\x18\x01 \x01(\tB\xac\x01\n\x19\x63om.google.cloud.batch.v1B\x0bVolumeProtoP\x01Z/cloud.google.com/go/batch/apiv1/batchpb;batchpb\xa2\x02\x03GCB\xaa\x02\x15Google.Cloud.Batch.V1\xca\x02\x15Google\\Cloud\\Batch\\V1\xea\x02\x18Google::Cloud::Batch::V1b\x06proto3" + +pool = Google::Protobuf::DescriptorPool.generated_pool + +begin + pool.add_serialized_file(descriptor_data) +rescue TypeError + # Compatibility code: will be removed in the next major version. + require 'google/protobuf/descriptor_pb' + parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) + parsed.clear_dependency + serialized = parsed.class.encode(parsed) + file = pool.add_serialized_file(serialized) + warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" + imports = [ + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Batch + module V1 + Volume = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Volume").msgclass + NFS = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.NFS").msgclass + GCS = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.GCS").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1.rb new file mode 100644 index 000000000000..f4e79be12505 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/iam/v1/iam_policy" +require "google/cloud/batch/v1/version" + +module Google + module Iam + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/iam/v1" + # client = ::Google::Iam::V1::IAMPolicy::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/iam/v1" + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new + # + module V1 + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/iam/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/bindings_override.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/bindings_override.rb new file mode 100644 index 000000000000..28c509f7998e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/bindings_override.rb @@ -0,0 +1,100 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/config" + +module Google + module Iam + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/iam/v1/rest" + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Iam"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + + default_config = Configuration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + + ## + # @private + # Configuration class for the google.iam.v1 package. + # + # This class contains common configuration for all services + # of the google.iam.v1 package. + # + # This configuration is for internal use of the client library classes, + # and it is not intended that the end-users will read or change it. + # + class Configuration + extend ::Gapic::Config + + # @private + # Overrides for http bindings for the RPC of the mixins for this package. + # Services in this package should use these when creating clients for the mixin services. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..545ca13e6168 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/batch/v1/version" + +require "google/iam/v1/iam_policy/credentials" +require "google/iam/v1/iam_policy/client" +require "google/iam/v1/iam_policy/rest" + +module Google + module Iam + module V1 + ## + # API Overview + # + # + # Manages Identity and Access Management (IAM) policies. + # + # Any implementation of an API that offers access control features + # implements the google.iam.v1.IAMPolicy interface. + # + # ## Data model + # + # Access control is applied when a principal (user or service account), takes + # some action on a resource exposed by a service. Resources, identified by + # URI-like names, are the unit of access control specification. Service + # implementations can choose the granularity of access control and the + # supported permissions for their resources. + # For example one database service may allow access control to be + # specified only at the Table level, whereas another might allow access control + # to also be specified at the Column level. + # + # ## Policy Structure + # + # See google.iam.v1.Policy + # + # This is intentionally not a CRUD style API because access control policies + # are created and deleted implicitly with the resources to which they are + # attached. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/iam/v1/iam_policy" + # client = ::Google::Iam::V1::IAMPolicy::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/iam/v1/iam_policy/rest" + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new + # + module IAMPolicy + end + end + end +end + +helper_path = ::File.join __dir__, "iam_policy", "helpers.rb" +require "google/iam/v1/iam_policy/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/client.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/client.rb new file mode 100644 index 000000000000..ffb701065c6f --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/client.rb @@ -0,0 +1,680 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/iam/v1/iam_policy_pb" +require "google/cloud/location" + +module Google + module Iam + module V1 + module IAMPolicy + ## + # Client for the IAMPolicy service. + # + # API Overview + # + # + # Manages Identity and Access Management (IAM) policies. + # + # Any implementation of an API that offers access control features + # implements the google.iam.v1.IAMPolicy interface. + # + # ## Data model + # + # Access control is applied when a principal (user or service account), takes + # some action on a resource exposed by a service. Resources, identified by + # URI-like names, are the unit of access control specification. Service + # implementations can choose the granularity of access control and the + # supported permissions for their resources. + # For example one database service may allow access control to be + # specified only at the Table level, whereas another might allow access control + # to also be specified at the Column level. + # + # ## Policy Structure + # + # See google.iam.v1.Policy + # + # This is intentionally not a CRUD style API because access control policies + # are created and deleted implicitly with the resources to which they are + # attached. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam-meta-api.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :iam_policy_stub + + ## + # Configure the IAMPolicy Client class. + # + # See {::Google::Iam::V1::IAMPolicy::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all IAMPolicy clients + # ::Google::Iam::V1::IAMPolicy::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Iam", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the IAMPolicy Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Iam::V1::IAMPolicy::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @iam_policy_stub.universe_domain + end + + ## + # Create a new IAMPolicy client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Iam::V1::IAMPolicy::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the IAMPolicy client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/iam/v1/iam_policy_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @iam_policy_stub = ::Gapic::ServiceStub.new( + ::Google::Iam::V1::IAMPolicy::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @iam_policy_stub.endpoint + config.universe_domain = @iam_policy_stub.universe_domain + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + # Service calls + + ## + # Sets the access control policy on the specified resource. Replaces any + # existing policy. + # + # Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_policy_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a resource. + # Returns an empty policy if the resource exists and does not have a policy + # set. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_policy_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on the specified resource. + # If the resource does not exist, this will return an empty set of + # permissions, not a `NOT_FOUND` error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_policy_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the IAMPolicy API. + # + # This class represents the configuration for IAMPolicy, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Iam::V1::IAMPolicy::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # set_iam_policy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::V1::IAMPolicy::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.set_iam_policy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.set_iam_policy.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "iam-meta-api.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the IAMPolicy API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/credentials.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/credentials.rb new file mode 100644 index 000000000000..493fd12e1228 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/credentials.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Iam + module V1 + module IAMPolicy + # Credentials for the IAMPolicy API. + class Credentials < ::Google::Auth::Credentials + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest.rb new file mode 100644 index 000000000000..fb49ff04155d --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/batch/v1/version" +require "google/iam/v1/bindings_override" + +require "google/iam/v1/iam_policy/credentials" +require "google/iam/v1/iam_policy/rest/client" + +module Google + module Iam + module V1 + ## + # API Overview + # + # + # Manages Identity and Access Management (IAM) policies. + # + # Any implementation of an API that offers access control features + # implements the google.iam.v1.IAMPolicy interface. + # + # ## Data model + # + # Access control is applied when a principal (user or service account), takes + # some action on a resource exposed by a service. Resources, identified by + # URI-like names, are the unit of access control specification. Service + # implementations can choose the granularity of access control and the + # supported permissions for their resources. + # For example one database service may allow access control to be + # specified only at the Table level, whereas another might allow access control + # to also be specified at the Column level. + # + # ## Policy Structure + # + # See google.iam.v1.Policy + # + # This is intentionally not a CRUD style API because access control policies + # are created and deleted implicitly with the resources to which they are + # attached. + # + # To load this service and instantiate a REST client: + # + # require "google/iam/v1/iam_policy/rest" + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new + # + module IAMPolicy + # Client for the REST transport + module Rest + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/iam/v1/iam_policy/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/client.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/client.rb new file mode 100644 index 000000000000..1bce6d2930a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/client.rb @@ -0,0 +1,641 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/iam/v1/iam_policy_pb" +require "google/iam/v1/iam_policy/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Iam + module V1 + module IAMPolicy + module Rest + ## + # REST client for the IAMPolicy service. + # + # API Overview + # + # + # Manages Identity and Access Management (IAM) policies. + # + # Any implementation of an API that offers access control features + # implements the google.iam.v1.IAMPolicy interface. + # + # ## Data model + # + # Access control is applied when a principal (user or service account), takes + # some action on a resource exposed by a service. Resources, identified by + # URI-like names, are the unit of access control specification. Service + # implementations can choose the granularity of access control and the + # supported permissions for their resources. + # For example one database service may allow access control to be + # specified only at the Table level, whereas another might allow access control + # to also be specified at the Column level. + # + # ## Policy Structure + # + # See google.iam.v1.Policy + # + # This is intentionally not a CRUD style API because access control policies + # are created and deleted implicitly with the resources to which they are + # attached. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam-meta-api.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :iam_policy_stub + + ## + # Configure the IAMPolicy Client class. + # + # See {::Google::Iam::V1::IAMPolicy::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all IAMPolicy clients + # ::Google::Iam::V1::IAMPolicy::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Iam", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the IAMPolicy Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Iam::V1::IAMPolicy::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @iam_policy_stub.universe_domain + end + + ## + # Create a new IAMPolicy REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the IAMPolicy client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @iam_policy_stub = ::Google::Iam::V1::IAMPolicy::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @iam_policy_stub.endpoint + config.universe_domain = @iam_policy_stub.universe_domain + config.bindings_override = @config.bindings_override + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + # Service calls + + ## + # Sets the access control policy on the specified resource. Replaces any + # existing policy. + # + # Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_policy_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a resource. + # Returns an empty policy if the resource exists and does not have a policy + # set. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_policy_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on the specified resource. + # If the resource does not exist, this will return an empty set of + # permissions, not a `NOT_FOUND` error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Batch::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_policy_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + return result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the IAMPolicy REST API. + # + # This class represents the configuration for IAMPolicy REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Iam::V1::IAMPolicy::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # set_iam_policy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::V1::IAMPolicy::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.set_iam_policy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.set_iam_policy.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "iam-meta-api.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the IAMPolicy API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb new file mode 100644 index 000000000000..bf0f194c281c --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb @@ -0,0 +1,247 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/iam/v1/iam_policy_pb" + +module Google + module Iam + module V1 + module IAMPolicy + module Rest + ## + # REST service stub for the IAMPolicy service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + raise_faraday_errors: false + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true + + yield result, operation if block_given? + result + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^.*$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^.*$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^.*$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/rest.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/rest.rb new file mode 100644 index 000000000000..04dfb925f559 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/rest.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/iam/v1/iam_policy/rest" +require "google/iam/v1/bindings_override" +require "google/cloud/batch/v1/version" + +module Google + module Iam + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/iam/v1/rest" + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new + # + module V1 + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-batch-v1/proto_docs/README.md new file mode 100644 index 000000000000..40b55bf3d716 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Batch V1 Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..2223d8935069 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/client.rb @@ -0,0 +1,420 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..b03587481349 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # An indicator of the behavior of a given field (for example, that a field + # is required in requests, or given as output but ignored as input). + # This **does not** change the behavior in protocol buffers itself; it only + # denotes the behavior and may affect how API tooling handles the field. + # + # Note: This enum **may** receive new values in the future. + module FieldBehavior + # Conventional default for enums. Do not use this. + FIELD_BEHAVIOR_UNSPECIFIED = 0 + + # Specifically denotes a field as optional. + # While all fields in protocol buffers are optional, this may be specified + # for emphasis if appropriate. + OPTIONAL = 1 + + # Denotes a field as required. + # This indicates that the field **must** be provided as part of the request, + # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + REQUIRED = 2 + + # Denotes a field as output only. + # This indicates that the field is provided in responses, but including the + # field in a request does nothing (the server *must* ignore it and + # *must not* throw an error as a result of the field's presence). + OUTPUT_ONLY = 3 + + # Denotes a field as input only. + # This indicates that the field is provided in requests, and the + # corresponding field is not included in output. + INPUT_ONLY = 4 + + # Denotes a field as immutable. + # This indicates that the field may be set once in a request to create a + # resource, but may not be changed thereafter. + IMMUTABLE = 5 + + # Denotes that a (repeated) field is an unordered list. + # This indicates that the service may provide the elements of the list + # in any arbitrary order, rather than the order the user originally + # provided. Additionally, the list's order may or may not be stable. + UNORDERED_LIST = 6 + + # Denotes that this field returns a non-empty default value if not set. + # This indicates that if the user provides the empty value in a request, + # a non-empty value will be returned. The user will not be aware of what + # non-empty value to expect. + NON_EMPTY_DEFAULT = 7 + + # Denotes that the field in a resource (a message annotated with + # google.api.resource) is used in the resource name to uniquely identify the + # resource. For AIP-compliant APIs, this should only be applied to the + # `name` field on the resource. + # + # This behavior should not be applied to references to other resources within + # the message. + # + # The identifier field of resources often have different field behavior + # depending on the request it is embedded in (e.g. for Create methods name + # is optional and unused, while for Update methods it is required). Instead + # of method-specific annotations, only `IDENTIFIER` is required. + IDENTIFIER = 8 + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..d558fed6cef1 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/field_info.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Rich semantic information of an API field beyond basic typing. + # @!attribute [rw] format + # @return [::Google::Api::FieldInfo::Format] + # The standard format of a field value. This does not explicitly configure + # any API consumer, just documents the API's format for the field it is + # applied to. + # @!attribute [rw] referenced_types + # @return [::Array<::Google::Api::TypeReference>] + # The type(s) that the annotated, generic field may represent. + # + # Currently, this must only be used on fields of type `google.protobuf.Any`. + # Supporting other generic types may be considered in the future. + class FieldInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The standard format of a field value. The supported formats are all backed + # by either an RFC defined by the IETF or a Google-defined AIP. + module Format + # Default, unspecified value. + FORMAT_UNSPECIFIED = 0 + + # Universally Unique Identifier, version 4, value as defined by + # https://datatracker.ietf.org/doc/html/rfc4122. The value may be + # normalized to entirely lowercase letters. For example, the value + # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to + # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. + UUID4 = 1 + + # Internet Protocol v4 value as defined by [RFC + # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be + # condensed, with leading zeros in each octet stripped. For example, + # `001.022.233.040` would be condensed to `1.22.233.40`. + IPV4 = 2 + + # Internet Protocol v6 value as defined by [RFC + # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be + # normalized to entirely lowercase letters with zeros compressed, following + # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, + # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. + IPV6 = 3 + + # An IP address in either v4 or v6 format as described by the individual + # values defined herein. See the comments on the IPV4 and IPV6 types for + # allowed normalizations of each. + IPV4_OR_IPV6 = 4 + end + end + + # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. + # @!attribute [rw] type_name + # @return [::String] + # The name of the type that the annotated, generic field may represent. + # If the type is in the same protobuf package, the value can be the simple + # message name e.g., `"MyMessage"`. Otherwise, the value must be the + # fully-qualified message name e.g., `"google.library.v1.Book"`. + # + # If the type(s) are unknown to the service (e.g. the field accepts generic + # user input), use the wildcard `"*"` to denote this behavior. + # + # See [AIP-202](https://google.aip.dev/202#type-references) for more details. + class TypeReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..38b4b61e6061 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..935946d52792 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # A simple descriptor of a resource type. + # + # ResourceDescriptor annotates a resource message (either by means of a + # protobuf annotation or use in the service config), and associates the + # resource's schema, the resource type, and the pattern of the resource name. + # + # Example: + # + # message Topic { + # // Indicates this message defines a resource schema. + # // Declares the resource type in the format of {service}/{kind}. + # // For Kubernetes resources, the format is {api group}/{kind}. + # option (google.api.resource) = { + # type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: "pubsub.googleapis.com/Topic" + # pattern: "projects/{project}/topics/{topic}" + # + # Sometimes, resources have multiple patterns, typically because they can + # live under multiple parents. + # + # Example: + # + # message LogEntry { + # option (google.api.resource) = { + # type: "logging.googleapis.com/LogEntry" + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # }; + # } + # + # The ResourceDescriptor Yaml config will look like: + # + # resources: + # - type: 'logging.googleapis.com/LogEntry' + # pattern: "projects/{project}/logs/{log}" + # pattern: "folders/{folder}/logs/{log}" + # pattern: "organizations/{organization}/logs/{log}" + # pattern: "billingAccounts/{billing_account}/logs/{log}" + # @!attribute [rw] type + # @return [::String] + # The resource type. It must be in the format of + # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be + # singular and must not include version numbers. + # + # Example: `storage.googleapis.com/Bucket` + # + # The value of the resource_type_kind must follow the regular expression + # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and + # should use PascalCase (UpperCamelCase). The maximum number of + # characters allowed for the `resource_type_kind` is 100. + # @!attribute [rw] pattern + # @return [::Array<::String>] + # Optional. The relative resource name pattern associated with this resource + # type. The DNS prefix of the full resource name shouldn't be specified here. + # + # The path pattern must follow the syntax, which aligns with HTTP binding + # syntax: + # + # Template = Segment { "/" Segment } ; + # Segment = LITERAL | Variable ; + # Variable = "{" LITERAL "}" ; + # + # Examples: + # + # - "projects/\\{project}/topics/\\{topic}" + # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" + # + # The components in braces correspond to the IDs for each resource in the + # hierarchy. It is expected that, if multiple patterns are provided, + # the same component name (e.g. "project") refers to IDs of the same + # type of resource. + # @!attribute [rw] name_field + # @return [::String] + # Optional. The field on the resource that designates the resource name + # field. If omitted, this is assumed to be "name". + # @!attribute [rw] history + # @return [::Google::Api::ResourceDescriptor::History] + # Optional. The historical or future-looking state of the resource pattern. + # + # Example: + # + # // The InspectTemplate message originally only supported resource + # // names with organization, and project was added later. + # message InspectTemplate { + # option (google.api.resource) = { + # type: "dlp.googleapis.com/InspectTemplate" + # pattern: + # "organizations/{organization}/inspectTemplates/{inspect_template}" + # pattern: "projects/{project}/inspectTemplates/{inspect_template}" + # history: ORIGINALLY_SINGLE_PATTERN + # }; + # } + # @!attribute [rw] plural + # @return [::String] + # The plural name used in the resource name and permission names, such as + # 'projects' for the resource name of 'projects/\\{project}' and the permission + # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception + # to this is for Nested Collections that have stuttering names, as defined + # in [AIP-122](https://google.aip.dev/122#nested-collections), where the + # collection ID in the resource name pattern does not necessarily directly + # match the `plural` value. + # + # It is the same concept of the `plural` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # + # Note: The plural form is required even for singleton resources. See + # https://aip.dev/156 + # @!attribute [rw] singular + # @return [::String] + # The same concept of the `singular` field in k8s CRD spec + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ + # Such as "project" for the `resourcemanager.googleapis.com/Project` type. + # @!attribute [rw] style + # @return [::Array<::Google::Api::ResourceDescriptor::Style>] + # Style flag(s) for this resource. + # These indicate that a resource is expected to conform to a given + # style. See the specific style flags for additional information. + class ResourceDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A description of the historical or future-looking state of the + # resource pattern. + module History + # The "unset" value. + HISTORY_UNSPECIFIED = 0 + + # The resource originally had one pattern and launched as such, and + # additional patterns were added later. + ORIGINALLY_SINGLE_PATTERN = 1 + + # The resource has one pattern, but the API owner expects to add more + # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents + # that from being necessary once there are multiple patterns.) + FUTURE_MULTI_PATTERN = 2 + end + + # A flag representing a specific style that a resource claims to conform to. + module Style + # The unspecified value. Do not use. + STYLE_UNSPECIFIED = 0 + + # This resource is intended to be "declarative-friendly". + # + # Declarative-friendly resources must be more strictly consistent, and + # setting this to true communicates to tools that this resource should + # adhere to declarative-friendly expectations. + # + # Note: This is used by the API linter (linter.aip.dev) to enable + # additional checks. + DECLARATIVE_FRIENDLY = 1 + end + end + + # Defines a proto annotation that describes a string field that refers to + # an API resource. + # @!attribute [rw] type + # @return [::String] + # The resource type that the annotated field references. + # + # Example: + # + # message Subscription { + # string topic = 2 [(google.api.resource_reference) = { + # type: "pubsub.googleapis.com/Topic" + # }]; + # } + # + # Occasionally, a field may reference an arbitrary resource. In this case, + # APIs use the special value * in their resource reference. + # + # Example: + # + # message GetIamPolicyRequest { + # string resource = 2 [(google.api.resource_reference) = { + # type: "*" + # }]; + # } + # @!attribute [rw] child_type + # @return [::String] + # The resource type of a child collection that the annotated field + # references. This is useful for annotating the `parent` field that + # doesn't have a fixed resource type. + # + # Example: + # + # message ListLogEntriesRequest { + # string parent = 1 [(google.api.resource_reference) = { + # child_type: "logging.googleapis.com/LogEntry" + # }; + # } + class ResourceReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/batch.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/batch.rb new file mode 100644 index 000000000000..fcc79d00334b --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/batch.rb @@ -0,0 +1,215 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Batch + module V1 + # CreateJob Request. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name where the Job will be created. + # Pattern: "projects/\\{project}/locations/\\{location}" + # @!attribute [rw] job_id + # @return [::String] + # ID used to uniquely identify the Job within its parent scope. + # This field should contain at most 63 characters and must start with + # lowercase characters. + # Only lowercase characters, numbers and '-' are accepted. + # The '-' character cannot be the first or the last one. + # A system generated ID will be used if the field is not set. + # + # The job.name field in the request will be ignored and the created resource + # name of the Job will be "\\{parent}/jobs/\\{job_id}". + # @!attribute [rw] job + # @return [::Google::Cloud::Batch::V1::Job] + # Required. The Job to create. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # GetJob Request. + # @!attribute [rw] name + # @return [::String] + # Required. Job name. + class GetJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # DeleteJob Request. + # @!attribute [rw] name + # @return [::String] + # Job name. + # @!attribute [rw] reason + # @return [::String] + # Optional. Reason for this deletion. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ListJob Request. + # @!attribute [rw] parent + # @return [::String] + # Parent path. + # @!attribute [rw] filter + # @return [::String] + # List filter. + # @!attribute [rw] order_by + # @return [::String] + # Optional. Sort results. Supported are "name", "name desc", "create_time", + # and "create_time desc". + # @!attribute [rw] page_size + # @return [::Integer] + # Page size. + # @!attribute [rw] page_token + # @return [::String] + # Page token. + class ListJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ListJob Response. + # @!attribute [rw] jobs + # @return [::Array<::Google::Cloud::Batch::V1::Job>] + # Jobs. + # @!attribute [rw] next_page_token + # @return [::String] + # Next page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ListTasks Request. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of a TaskGroup from which Tasks are being requested. + # Pattern: + # "projects/\\{project}/locations/\\{location}/jobs/\\{job}/taskGroups/\\{task_group}" + # @!attribute [rw] filter + # @return [::String] + # Task filter, null filter matches all Tasks. + # Filter string should be of the format State=TaskStatus.State e.g. + # State=RUNNING + # @!attribute [rw] page_size + # @return [::Integer] + # Page size. + # @!attribute [rw] page_token + # @return [::String] + # Page token. + class ListTasksRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ListTasks Response. + # @!attribute [rw] tasks + # @return [::Array<::Google::Cloud::Batch::V1::Task>] + # Tasks. + # @!attribute [rw] next_page_token + # @return [::String] + # Next page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListTasksResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for a single Task by name. + # @!attribute [rw] name + # @return [::String] + # Required. Task name. + class GetTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the long-running operation. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. Operations that have successfully been cancelled + # have [Operation.error][] value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/job.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/job.rb new file mode 100644 index 000000000000..a7863d2554da --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/job.rb @@ -0,0 +1,743 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Batch + module V1 + # The Cloud Batch Job description. + # @!attribute [r] name + # @return [::String] + # Output only. Job name. + # For example: "projects/123456/locations/us-central1/jobs/job01". + # @!attribute [r] uid + # @return [::String] + # Output only. A system generated unique ID for the Job. + # @!attribute [rw] priority + # @return [::Integer] + # Priority of the Job. + # The valid value range is [0, 100). Default value is 0. + # Higher value indicates higher priority. + # A job with higher priority value is more likely to run earlier if all other + # requirements are satisfied. + # @!attribute [rw] task_groups + # @return [::Array<::Google::Cloud::Batch::V1::TaskGroup>] + # Required. TaskGroups in the Job. Only one TaskGroup is supported now. + # @!attribute [rw] allocation_policy + # @return [::Google::Cloud::Batch::V1::AllocationPolicy] + # Compute resource allocation for all TaskGroups in the Job. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels for the Job. Labels could be user provided or system generated. + # For example, + # "labels": { + # "department": "finance", + # "environment": "test" + # } + # You can assign up to 64 labels. [Google Compute Engine label + # restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) + # apply. + # Label names that start with "goog-" or "google-" are reserved. + # @!attribute [r] status + # @return [::Google::Cloud::Batch::V1::JobStatus] + # Output only. Job status. It is read only for users. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. When the Job was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last time the Job was updated. + # @!attribute [rw] logs_policy + # @return [::Google::Cloud::Batch::V1::LogsPolicy] + # Log preservation policy for the Job. + # @!attribute [rw] notifications + # @return [::Array<::Google::Cloud::Batch::V1::JobNotification>] + # Notification configurations. + class Job + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # LogsPolicy describes how outputs from a Job's Tasks (stdout/stderr) will be + # preserved. + # @!attribute [rw] destination + # @return [::Google::Cloud::Batch::V1::LogsPolicy::Destination] + # Where logs should be saved. + # @!attribute [rw] logs_path + # @return [::String] + # The path to which logs are saved when the destination = PATH. This can be a + # local file path on the VM, or under the mount point of a Persistent Disk or + # Filestore, or a Cloud Storage path. + # @!attribute [rw] cloud_logging_option + # @return [::Google::Cloud::Batch::V1::LogsPolicy::CloudLoggingOption] + # Optional. Additional settings for Cloud Logging. It will only take effect + # when the destination of `LogsPolicy` is set to `CLOUD_LOGGING`. + class LogsPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # `CloudLoggingOption` contains additional settings for Cloud Logging logs + # generated by Batch job. + # @!attribute [rw] use_generic_task_monitored_resource + # @return [::Boolean] + # Optional. Set this flag to true to change the [monitored resource + # type](https://cloud.google.com/monitoring/api/resources) for + # Cloud Logging logs generated by this Batch job from + # the + # [`batch.googleapis.com/Job`](https://cloud.google.com/monitoring/api/resources#tag_batch.googleapis.com/Job) + # type to the formerly used + # [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task) + # type. + class CloudLoggingOption + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The destination (if any) for logs. + module Destination + # Logs are not preserved. + DESTINATION_UNSPECIFIED = 0 + + # Logs are streamed to Cloud Logging. + CLOUD_LOGGING = 1 + + # Logs are saved to a file path. + PATH = 2 + end + end + + # Job status. + # @!attribute [rw] state + # @return [::Google::Cloud::Batch::V1::JobStatus::State] + # Job state + # @!attribute [rw] status_events + # @return [::Array<::Google::Cloud::Batch::V1::StatusEvent>] + # Job status events + # @!attribute [rw] task_groups + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Batch::V1::JobStatus::TaskGroupStatus}] + # Aggregated task status for each TaskGroup in the Job. + # The map key is TaskGroup ID. + # @!attribute [rw] run_duration + # @return [::Google::Protobuf::Duration] + # The duration of time that the Job spent in status RUNNING. + class JobStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # VM instance status. + # @!attribute [rw] machine_type + # @return [::String] + # The Compute Engine machine type. + # @!attribute [rw] provisioning_model + # @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel] + # The VM instance provisioning model. + # @!attribute [rw] task_pack + # @return [::Integer] + # The max number of tasks can be assigned to this instance type. + # @!attribute [rw] boot_disk + # @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk] + # The VM boot disk. + class InstanceStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Aggregated task status for a TaskGroup. + # @!attribute [rw] counts + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # Count of task in each state in the TaskGroup. + # The map key is task state name. + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::Batch::V1::JobStatus::InstanceStatus>] + # Status of instances allocated for the TaskGroup. + class TaskGroupStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class CountsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Batch::V1::JobStatus::TaskGroupStatus] + class TaskGroupsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Valid Job states. + module State + # Job state unspecified. + STATE_UNSPECIFIED = 0 + + # Job is admitted (validated and persisted) and waiting for resources. + QUEUED = 1 + + # Job is scheduled to run as soon as resource allocation is ready. + # The resource allocation may happen at a later time but with a high + # chance to succeed. + SCHEDULED = 2 + + # Resource allocation has been successful. At least one Task in the Job is + # RUNNING. + RUNNING = 3 + + # All Tasks in the Job have finished successfully. + SUCCEEDED = 4 + + # At least one Task in the Job has failed. + FAILED = 5 + + # The Job will be deleted, but has not been deleted yet. Typically this is + # because resources used by the Job are still being cleaned up. + DELETION_IN_PROGRESS = 6 + end + end + + # Notification configurations. + # @!attribute [rw] pubsub_topic + # @return [::String] + # The Pub/Sub topic where notifications for the job, like state + # changes, will be published. If undefined, no Pub/Sub notifications + # are sent for this job. + # + # Specify the topic using the following format: + # `projects/{project}/topics/{topic}`. + # Notably, if you want to specify a Pub/Sub topic that is in a + # different project than the job, your administrator must grant your + # project's Batch service agent permission to publish to that topic. + # + # For more information about configuring Pub/Sub notifications for + # a job, see + # https://cloud.google.com/batch/docs/enable-notifications. + # @!attribute [rw] message + # @return [::Google::Cloud::Batch::V1::JobNotification::Message] + # The attribute requirements of messages to be sent to this Pub/Sub topic. + # Without this field, no message will be sent. + class JobNotification + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message details. + # Describe the conditions under which messages will be sent. + # If no attribute is defined, no message will be sent by default. + # One message should specify either the job or the task level attributes, + # but not both. For example, + # job level: JOB_STATE_CHANGED and/or a specified new_job_state; + # task level: TASK_STATE_CHANGED and/or a specified new_task_state. + # @!attribute [rw] type + # @return [::Google::Cloud::Batch::V1::JobNotification::Type] + # The message type. + # @!attribute [rw] new_job_state + # @return [::Google::Cloud::Batch::V1::JobStatus::State] + # The new job state. + # @!attribute [rw] new_task_state + # @return [::Google::Cloud::Batch::V1::TaskStatus::State] + # The new task state. + class Message + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The message type. + module Type + # Unspecified. + TYPE_UNSPECIFIED = 0 + + # Notify users that the job state has changed. + JOB_STATE_CHANGED = 1 + + # Notify users that the task state has changed. + TASK_STATE_CHANGED = 2 + end + end + + # A Job's resource allocation policy describes when, where, and how compute + # resources should be allocated for the Job. + # @!attribute [rw] location + # @return [::Google::Cloud::Batch::V1::AllocationPolicy::LocationPolicy] + # Location where compute resources should be allocated for the Job. + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicyOrTemplate>] + # Describe instances that can be created by this AllocationPolicy. + # Only instances[0] is supported now. + # @!attribute [rw] service_account + # @return [::Google::Cloud::Batch::V1::ServiceAccount] + # Defines the service account for Batch-created VMs. If omitted, the [default + # Compute Engine service + # account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) + # is used. Must match the service account specified in any used instance + # template configured in the Batch job. + # + # Includes the following fields: + # * email: The service account's email address. If not set, the default + # Compute Engine service account is used. + # * scopes: Additional OAuth scopes to grant the service account, beyond the + # default cloud-platform scope. (list of strings) + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels applied to all VM instances and other resources + # created by AllocationPolicy. + # Labels could be user provided or system generated. + # You can assign up to 64 labels. [Google Compute Engine label + # restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) + # apply. + # Label names that start with "goog-" or "google-" are reserved. + # @!attribute [rw] network + # @return [::Google::Cloud::Batch::V1::AllocationPolicy::NetworkPolicy] + # The network policy. + # + # If you define an instance template in the `InstancePolicyOrTemplate` field, + # Batch will use the network settings in the instance template instead of + # this field. + # @!attribute [rw] placement + # @return [::Google::Cloud::Batch::V1::AllocationPolicy::PlacementPolicy] + # The placement policy. + # @!attribute [rw] tags + # @return [::Array<::String>] + # Optional. Tags applied to the VM instances. + # + # The tags identify valid sources or targets for network firewalls. + # Each tag must be 1-63 characters long, and comply with + # [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). + class AllocationPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] allowed_locations + # @return [::Array<::String>] + # A list of allowed location names represented by internal URLs. + # + # Each location can be a region or a zone. + # Only one region or multiple zones in one region is supported now. + # For example, + # ["regions/us-central1"] allow VMs in any zones in region us-central1. + # ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs + # in zones us-central1-a and us-central1-c. + # + # Mixing locations from different regions would cause errors. + # For example, + # ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", + # "zones/us-west1-a"] contains locations from two distinct regions: + # us-central1 and us-west1. This combination will trigger an error. + class LocationPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A new persistent disk or a local ssd. + # A VM can only have one local SSD setting but multiple local SSD partitions. + # See https://cloud.google.com/compute/docs/disks#pdspecs and + # https://cloud.google.com/compute/docs/disks#localssds. + # @!attribute [rw] image + # @return [::String] + # URL for a VM image to use as the data source for this disk. + # For example, the following are all valid URLs: + # + # * Specify the image by its family name: + # projects/\\{project}/global/images/family/\\{image_family} + # * Specify the image version: + # projects/\\{project}/global/images/\\{image_version} + # + # You can also use Batch customized image in short names. + # The following image values are supported for a boot disk: + # + # * `batch-debian`: use Batch Debian images. + # * `batch-cos`: use Batch Container-Optimized images. + # * `batch-hpc-rocky`: use Batch HPC Rocky Linux images. + # @!attribute [rw] snapshot + # @return [::String] + # Name of a snapshot used as the data source. + # Snapshot is not supported as boot disk now. + # @!attribute [rw] type + # @return [::String] + # Disk type as shown in `gcloud compute disk-types list`. + # For example, local SSD uses type "local-ssd". + # Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" + # or "pd-standard". If not specified, "pd-standard" will be used as the + # default type for non-boot disks, "pd-balanced" will be used as the + # default type for boot disks. + # @!attribute [rw] size_gb + # @return [::Integer] + # Disk size in GB. + # + # **Non-Boot Disk**: + # If the `type` specifies a persistent disk, this field + # is ignored if `data_source` is set as `image` or `snapshot`. + # If the `type` specifies a local SSD, this field should be a multiple of + # 375 GB, otherwise, the final size will be the next greater multiple of + # 375 GB. + # + # **Boot Disk**: + # Batch will calculate the boot disk size based on source + # image and task requirements if you do not speicify the size. + # If both this field and the `boot_disk_mib` field in task spec's + # `compute_resource` are defined, Batch will only honor this field. + # Also, this field should be no smaller than the source disk's + # size when the `data_source` is set as `snapshot` or `image`. + # For example, if you set an image as the `data_source` field and the + # image's default disk size 30 GB, you can only use this field to make the + # disk larger or equal to 30 GB. + # @!attribute [rw] disk_interface + # @return [::String] + # Local SSDs are available through both "SCSI" and "NVMe" interfaces. + # If not indicated, "NVMe" will be the default one for local ssds. + # This field is ignored for persistent disks as the interface is chosen + # automatically. See + # https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface. + class Disk + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A new or an existing persistent disk (PD) or a local ssd attached to a VM + # instance. + # @!attribute [rw] new_disk + # @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk] + # @!attribute [rw] existing_disk + # @return [::String] + # Name of an existing PD. + # @!attribute [rw] device_name + # @return [::String] + # Device name that the guest operating system will see. + # It is used by Runnable.volumes field to mount disks. So please specify + # the device_name if you want Batch to help mount the disk, and it should + # match the device_name field in volumes. + class AttachedDisk + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Accelerator describes Compute Engine accelerators to be attached to the VM. + # @!attribute [rw] type + # @return [::String] + # The accelerator type. For example, "nvidia-tesla-t4". + # See `gcloud compute accelerator-types list`. + # @!attribute [rw] count + # @return [::Integer] + # The number of accelerators of this type. + # @!attribute [rw] install_gpu_drivers + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Boolean] + # Deprecated: please use instances[0].install_gpu_drivers instead. + # @!attribute [rw] driver_version + # @return [::String] + # Optional. The NVIDIA GPU driver version that should be installed for this + # type. + # + # You can define the specific driver version such as "470.103.01", + # following the driver version requirements in + # https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver. + # Batch will install the specific accelerator driver if qualified. + class Accelerator + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # InstancePolicy describes an instance type and resources attached to each VM + # created by this InstancePolicy. + # @!attribute [rw] machine_type + # @return [::String] + # The Compute Engine machine type. + # @!attribute [rw] min_cpu_platform + # @return [::String] + # The minimum CPU platform. + # See + # https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + # @!attribute [rw] provisioning_model + # @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel] + # The provisioning model. + # @!attribute [rw] accelerators + # @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>] + # The accelerators attached to each VM instance. + # @!attribute [rw] boot_disk + # @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk] + # Boot disk to be created and attached to each VM by this InstancePolicy. + # Boot disk will be deleted when the VM is deleted. + # Batch API now only supports booting from image. + # @!attribute [rw] disks + # @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>] + # Non-boot disks to be attached for each VM created by this InstancePolicy. + # New disks will be deleted when the VM is deleted. + # A non-boot disk is a disk that can be of a device with a + # file system or a raw storage drive that is not ready for data + # storage and accessing. + # @!attribute [rw] reservation + # @return [::String] + # Optional. If specified, VMs will consume only the specified reservation. + # If not specified (default), VMs will consume any applicable reservation. + class InstancePolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # InstancePolicyOrTemplate lets you define the type of resources to use for + # this job either with an InstancePolicy or an instance template. + # If undefined, Batch picks the type of VM to use and doesn't include + # optional VM resources such as GPUs and extra disks. + # @!attribute [rw] policy + # @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy] + # InstancePolicy. + # @!attribute [rw] instance_template + # @return [::String] + # Name of an instance template used to create VMs. + # Named the field as 'instance_template' instead of 'template' to avoid + # c++ keyword conflict. + # @!attribute [rw] install_gpu_drivers + # @return [::Boolean] + # Set this field true if you want Batch to help fetch drivers from a third + # party location and install them for GPUs specified in + # `policy.accelerators` or `instance_template` on your behalf. Default is + # false. + # + # For Container-Optimized Image cases, Batch will install the + # accelerator driver following milestones of + # https://cloud.google.com/container-optimized-os/docs/release-notes. For + # non Container-Optimized Image cases, following + # https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py. + # @!attribute [rw] install_ops_agent + # @return [::Boolean] + # Optional. Set this field true if you want Batch to install Ops Agent on + # your behalf. Default is false. + # @!attribute [rw] block_project_ssh_keys + # @return [::Boolean] + # Optional. Set this field to `true` if you want Batch to block + # project-level SSH keys from accessing this job's VMs. Alternatively, you + # can configure the job to specify a VM instance template that blocks + # project-level SSH keys. In either case, Batch blocks project-level SSH + # keys while creating the VMs for this job. + # + # Batch allows project-level SSH keys for a job's VMs only if all + # the following are true: + # + # + This field is undefined or set to `false`. + # + The job's VM instance template (if any) doesn't block project-level + # SSH keys. + # + # Notably, you can override this behavior by manually updating a VM to + # block or allow project-level SSH keys. For more information about + # blocking project-level SSH keys, see the Compute Engine documentation: + # https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys + class InstancePolicyOrTemplate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A network interface. + # @!attribute [rw] network + # @return [::String] + # The URL of an existing network resource. + # You can specify the network as a full or partial URL. + # + # For example, the following are all valid URLs: + # + # * https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network} + # * projects/\\{project}/global/networks/\\{network} + # * global/networks/\\{network} + # @!attribute [rw] subnetwork + # @return [::String] + # The URL of an existing subnetwork resource in the network. + # You can specify the subnetwork as a full or partial URL. + # + # For example, the following are all valid URLs: + # + # * https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork} + # * projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork} + # * regions/\\{region}/subnetworks/\\{subnetwork} + # @!attribute [rw] no_external_ip_address + # @return [::Boolean] + # Default is false (with an external IP address). Required if + # no external public IP address is attached to the VM. If no external + # public IP address, additional configuration is required to allow the VM + # to access Google Services. See + # https://cloud.google.com/vpc/docs/configure-private-google-access and + # https://cloud.google.com/nat/docs/gce-example#create-nat for more + # information. + class NetworkInterface + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # NetworkPolicy describes VM instance network configurations. + # @!attribute [rw] network_interfaces + # @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>] + # Network configurations. + class NetworkPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # PlacementPolicy describes a group placement policy for the VMs controlled + # by this AllocationPolicy. + # @!attribute [rw] collocation + # @return [::String] + # UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you + # want VMs to be located close to each other for low network latency + # between the VMs. No placement policy will be generated when collocation + # is UNSPECIFIED. + # @!attribute [rw] max_distance + # @return [::Integer] + # When specified, causes the job to fail if more than max_distance logical + # switches are required between VMs. Batch uses the most compact possible + # placement of VMs even when max_distance is not specified. An explicit + # max_distance makes that level of compactness a strict requirement. + # Not yet implemented + class PlacementPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Compute Engine VM instance provisioning model. + module ProvisioningModel + # Unspecified. + PROVISIONING_MODEL_UNSPECIFIED = 0 + + # Standard VM. + STANDARD = 1 + + # SPOT VM. + SPOT = 2 + + # Preemptible VM (PVM). + # + # Above SPOT VM is the preferable model for preemptible VM instances: the + # old preemptible VM model (indicated by this field) is the older model, + # and has been migrated to use the SPOT model as the underlying technology. + # This old model will still be supported. + PREEMPTIBLE = 3 + end + end + + # A TaskGroup defines one or more Tasks that all share the same TaskSpec. + # @!attribute [r] name + # @return [::String] + # Output only. TaskGroup name. + # The system generates this field based on parent Job name. + # For example: + # "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". + # @!attribute [rw] task_spec + # @return [::Google::Cloud::Batch::V1::TaskSpec] + # Required. Tasks in the group share the same task spec. + # @!attribute [rw] task_count + # @return [::Integer] + # Number of Tasks in the TaskGroup. + # Default is 1. + # @!attribute [rw] parallelism + # @return [::Integer] + # Max number of tasks that can run in parallel. + # Default to min(task_count, parallel tasks per job limit). + # See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits). + # Field parallelism must be 1 if the scheduling_policy is IN_ORDER. + # @!attribute [rw] scheduling_policy + # @return [::Google::Cloud::Batch::V1::TaskGroup::SchedulingPolicy] + # Scheduling policy for Tasks in the TaskGroup. + # The default value is AS_SOON_AS_POSSIBLE. + # @!attribute [rw] task_environments + # @return [::Array<::Google::Cloud::Batch::V1::Environment>] + # An array of environment variable mappings, which are passed to Tasks with + # matching indices. If task_environments is used then task_count should + # not be specified in the request (and will be ignored). Task count will be + # the length of task_environments. + # + # Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in + # addition to any environment variables set in task_environments, specifying + # the number of Tasks in the Task's parent TaskGroup, and the specific Task's + # index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). + # @!attribute [rw] task_count_per_node + # @return [::Integer] + # Max number of tasks that can be run on a VM at the same time. + # If not specified, the system will decide a value based on available + # compute resources on a VM and task requirements. + # @!attribute [rw] require_hosts_file + # @return [::Boolean] + # When true, Batch will populate a file with a list of all VMs assigned to + # the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path + # of that file. Defaults to false. The host file supports up to 1000 VMs. + # @!attribute [rw] permissive_ssh + # @return [::Boolean] + # When true, Batch will configure SSH to allow passwordless login between + # VMs running the Batch tasks in the same TaskGroup. + # @!attribute [rw] run_as_non_root + # @return [::Boolean] + # Optional. If not set or set to false, Batch uses the root user to execute + # runnables. If set to true, Batch runs the runnables using a non-root user. + # Currently, the non-root user Batch used is generated by OS Login. For more + # information, see [About OS + # Login](https://cloud.google.com/compute/docs/oslogin). + class TaskGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # How Tasks in the TaskGroup should be scheduled relative to each other. + module SchedulingPolicy + # Unspecified. + SCHEDULING_POLICY_UNSPECIFIED = 0 + + # Run Tasks as soon as resources are available. + # + # Tasks might be executed in parallel depending on parallelism and + # task_count values. + AS_SOON_AS_POSSIBLE = 1 + + # Run Tasks sequentially with increased task index. + IN_ORDER = 2 + end + end + + # Carries information about a Google Cloud service account. + # @!attribute [rw] email + # @return [::String] + # Email address of the service account. + # @!attribute [rw] scopes + # @return [::Array<::String>] + # List of scopes to be enabled for this service account. + class ServiceAccount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/task.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/task.rb new file mode 100644 index 000000000000..3602cd75311a --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/task.rb @@ -0,0 +1,537 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Batch + module V1 + # Compute resource requirements. + # + # ComputeResource defines the amount of resources required for each task. + # Make sure your tasks have enough resources to successfully run. + # If you also define the types of resources for a job to use with the + # [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + # field, make sure both fields are compatible with each other. + # @!attribute [rw] cpu_milli + # @return [::Integer] + # The milliCPU count. + # + # `cpuMilli` defines the amount of CPU resources per task in milliCPU units. + # For example, `1000` corresponds to 1 vCPU per task. If undefined, the + # default value is `2000`. + # + # If you also define the VM's machine type using the `machineType` in + # [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + # field or inside the `instanceTemplate` in the + # [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + # field, make sure the CPU resources for both fields are compatible with each + # other and with how many tasks you want to allow to run on the same VM at + # the same time. + # + # For example, if you specify the `n2-standard-2` machine type, which has 2 + # vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or + # you are recommended to run two tasks on the same VM if you set `cpuMilli` + # to `1000` or less. + # @!attribute [rw] memory_mib + # @return [::Integer] + # Memory in MiB. + # + # `memoryMib` defines the amount of memory per task in MiB units. + # If undefined, the default value is `2000`. + # If you also define the VM's machine type using the `machineType` in + # [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) + # field or inside the `instanceTemplate` in the + # [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) + # field, make sure the memory resources for both fields are compatible with + # each other and with how many tasks you want to allow to run on the same VM + # at the same time. + # + # For example, if you specify the `n2-standard-2` machine type, which has 8 + # GiB each, you are recommended to set `memoryMib` to no more than `8192`, + # or you are recommended to run two tasks on the same VM if you set + # `memoryMib` to `4096` or less. + # @!attribute [rw] boot_disk_mib + # @return [::Integer] + # Extra boot disk size in MiB for each task. + class ComputeResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Status event. + # @!attribute [rw] type + # @return [::String] + # Type of the event. + # @!attribute [rw] description + # @return [::String] + # Description of the event. + # @!attribute [rw] event_time + # @return [::Google::Protobuf::Timestamp] + # The time this event occurred. + # @!attribute [rw] task_execution + # @return [::Google::Cloud::Batch::V1::TaskExecution] + # Task Execution. + # This field is only defined for task-level status events where the task + # fails. + # @!attribute [rw] task_state + # @return [::Google::Cloud::Batch::V1::TaskStatus::State] + # Task State. + # This field is only defined for task-level status events. + class StatusEvent + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This Task Execution field includes detail information for + # task execution procedures, based on StatusEvent types. + # @!attribute [rw] exit_code + # @return [::Integer] + # The exit code of a finished task. + # + # If the task succeeded, the exit code will be 0. If the task failed but not + # due to the following reasons, the exit code will be 50000. + # + # Otherwise, it can be from different sources: + # * Batch known failures: + # https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. + # * Batch runnable execution failures; you can rely on Batch logs to further + # diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If + # there are multiple runnables failures, Batch only exposes the first error. + class TaskExecution + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Status of a task. + # @!attribute [rw] state + # @return [::Google::Cloud::Batch::V1::TaskStatus::State] + # Task state. + # @!attribute [rw] status_events + # @return [::Array<::Google::Cloud::Batch::V1::StatusEvent>] + # Detailed info about why the state is reached. + class TaskStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Task states. + module State + # Unknown state. + STATE_UNSPECIFIED = 0 + + # The Task is created and waiting for resources. + PENDING = 1 + + # The Task is assigned to at least one VM. + ASSIGNED = 2 + + # The Task is running. + RUNNING = 3 + + # The Task has failed. + FAILED = 4 + + # The Task has succeeded. + SUCCEEDED = 5 + + # The Task has not been executed when the Job finishes. + UNEXECUTED = 6 + end + end + + # Runnable describes instructions for executing a specific script or container + # as part of a Task. + # @!attribute [rw] container + # @return [::Google::Cloud::Batch::V1::Runnable::Container] + # Container runnable. + # @!attribute [rw] script + # @return [::Google::Cloud::Batch::V1::Runnable::Script] + # Script runnable. + # @!attribute [rw] barrier + # @return [::Google::Cloud::Batch::V1::Runnable::Barrier] + # Barrier runnable. + # @!attribute [rw] display_name + # @return [::String] + # Optional. DisplayName is an optional field that can be provided by the + # caller. If provided, it will be used in logs and other outputs to identify + # the script, making it easier for users to understand the logs. If not + # provided the index of the runnable will be used for outputs. + # @!attribute [rw] ignore_exit_status + # @return [::Boolean] + # Normally, a runnable that returns a non-zero exit status fails and causes + # the task to fail. However, you can set this field to `true` to allow the + # task to continue executing its other runnables even if this runnable + # fails. + # @!attribute [rw] background + # @return [::Boolean] + # Normally, a runnable that doesn't exit causes its task to fail. However, + # you can set this field to `true` to configure a background runnable. + # Background runnables are allowed continue running in the background while + # the task executes subsequent runnables. For example, background runnables + # are useful for providing services to other runnables or providing + # debugging-support tools like SSH servers. + # + # Specifically, background runnables are killed automatically (if they have + # not already exited) a short time after all foreground runnables have + # completed. Even though this is likely to result in a non-zero exit status + # for the background runnable, these automatic kills are not treated as task + # failures. + # @!attribute [rw] always_run + # @return [::Boolean] + # By default, after a Runnable fails, no further Runnable are executed. This + # flag indicates that this Runnable must be run even if the Task has already + # failed. This is useful for Runnables that copy output files off of the VM + # or for debugging. + # + # The always_run flag does not override the Task's overall max_run_duration. + # If the max_run_duration has expired then no further Runnables will execute, + # not even always_run Runnables. + # @!attribute [rw] environment + # @return [::Google::Cloud::Batch::V1::Environment] + # Environment variables for this Runnable (overrides variables set for the + # whole Task or TaskGroup). + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # Timeout for this Runnable. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels for this Runnable. + class Runnable + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Container runnable. + # @!attribute [rw] image_uri + # @return [::String] + # Required. The URI to pull the container image from. + # @!attribute [rw] commands + # @return [::Array<::String>] + # Required for some container images. Overrides the `CMD` specified in the + # container. If there is an `ENTRYPOINT` (either in the container image or + # with the `entrypoint` field below) then these commands are appended as + # arguments to the `ENTRYPOINT`. + # @!attribute [rw] entrypoint + # @return [::String] + # Required for some container images. Overrides the `ENTRYPOINT` specified + # in the container. + # @!attribute [rw] volumes + # @return [::Array<::String>] + # Volumes to mount (bind mount) from the host machine files or directories + # into the container, formatted to match `--volume` option for the + # `docker run` command—for example, `/foo:/bar` or `/foo:/bar:ro`. + # + # If the `TaskSpec.Volumes` field is specified but this field is not, Batch + # will mount each volume from the host machine to the container with the + # same mount path by default. In this case, the default mount option for + # containers will be read-only (`ro`) for existing persistent disks and + # read-write (`rw`) for other volume types, regardless of the original + # mount options specified in `TaskSpec.Volumes`. If you need different + # mount settings, you can explicitly configure them in this field. + # @!attribute [rw] options + # @return [::String] + # Required for some container images. Arbitrary additional options to + # include in the `docker run` command when running this container—for + # example, `--network host`. For the `--volume` option, use the `volumes` + # field for the container. + # @!attribute [rw] block_external_network + # @return [::Boolean] + # If set to true, external network access to and from container will be + # blocked, containers that are with block_external_network as true can + # still communicate with each other, network cannot be specified in the + # `container.options` field. + # @!attribute [rw] username + # @return [::String] + # Required if the container image is from a private Docker registry. The + # username to login to the Docker registry that contains the image. + # + # You can either specify the username directly by using plain text or + # specify an encrypted username by using a Secret Manager secret: + # `projects/*/secrets/*/versions/*`. However, using a secret is + # recommended for enhanced security. + # + # Caution: If you specify the username using plain text, you risk the + # username being exposed to any users who can view the job or its logs. + # To avoid this risk, specify a secret that contains the username instead. + # + # Learn more about [Secret + # Manager](https://cloud.google.com/secret-manager/docs/) and [using + # Secret Manager with + # Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + # @!attribute [rw] password + # @return [::String] + # Required if the container image is from a private Docker registry. The + # password to login to the Docker registry that contains the image. + # + # For security, it is strongly recommended to specify an + # encrypted password by using a Secret Manager secret: + # `projects/*/secrets/*/versions/*`. + # + # Warning: If you specify the password using plain text, you risk the + # password being exposed to any users who can view the job or its logs. + # To avoid this risk, specify a secret that contains the password instead. + # + # Learn more about [Secret + # Manager](https://cloud.google.com/secret-manager/docs/) and [using + # Secret Manager with + # Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). + # @!attribute [rw] enable_image_streaming + # @return [::Boolean] + # Optional. If set to true, this container runnable uses Image streaming. + # + # Use Image streaming to allow the runnable to initialize without + # waiting for the entire container image to download, which can + # significantly reduce startup time for large container images. + # + # When `enableImageStreaming` is set to true, the container + # runtime is [containerd](https://containerd.io/) instead of Docker. + # Additionally, this container runnable only supports the following + # `container` subfields: `imageUri`, + # `commands[]`, `entrypoint`, and + # `volumes[]`; any other `container` subfields are ignored. + # + # For more information about the requirements and limitations for using + # Image streaming with Batch, see the [`image-streaming` + # sample on + # GitHub](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming). + class Container + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Script runnable. + # @!attribute [rw] path + # @return [::String] + # The path to a script file that is accessible from the host VM(s). + # + # Unless the script file supports the default `#!/bin/sh` shell + # interpreter, you must specify an interpreter by including a + # [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) as the + # first line of the file. For example, to execute the script using bash, + # include `#!/bin/bash` as the first line of the file. Alternatively, + # to execute the script using Python3, include `#!/usr/bin/env python3` + # as the first line of the file. + # @!attribute [rw] text + # @return [::String] + # The text for a script. + # + # Unless the script text supports the default `#!/bin/sh` shell + # interpreter, you must specify an interpreter by including a + # [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) at the + # beginning of the text. For example, to execute the script using bash, + # include `#!/bin/bash\n` at the beginning of the text. Alternatively, + # to execute the script using Python3, include `#!/usr/bin/env python3\n` + # at the beginning of the text. + class Script + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A barrier runnable automatically blocks the execution of subsequent + # runnables until all the tasks in the task group reach the barrier. + # @!attribute [rw] name + # @return [::String] + # Barriers are identified by their index in runnable list. + # Names are not required, but if present should be an identifier. + class Barrier + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Spec of a task + # @!attribute [rw] runnables + # @return [::Array<::Google::Cloud::Batch::V1::Runnable>] + # Required. The sequence of one or more runnables (executable scripts, + # executable containers, and/or barriers) for each task in this task group to + # run. Each task runs this list of runnables in order. For a task to succeed, + # all of its script and container runnables each must meet at least one of + # the following conditions: + # + # + The runnable exited with a zero status. + # + The runnable didn't finish, but you enabled its `background` subfield. + # + The runnable exited with a non-zero status, but you enabled its + # `ignore_exit_status` subfield. + # @!attribute [rw] compute_resource + # @return [::Google::Cloud::Batch::V1::ComputeResource] + # ComputeResource requirements. + # @!attribute [rw] max_run_duration + # @return [::Google::Protobuf::Duration] + # Maximum duration the task should run before being automatically retried + # (if enabled) or automatically failed. Format the value of this field + # as a time limit in seconds followed by `s`—for example, `3600s` + # for 1 hour. The field accepts any value between 0 and the maximum listed + # for the `Duration` field type at + # https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, + # the actual maximum run time for a job will be limited to the maximum run + # time for a job listed at + # https://cloud.google.com/batch/quotas#max-job-duration. + # @!attribute [rw] max_retry_count + # @return [::Integer] + # Maximum number of retries on failures. + # The default, 0, which means never retry. + # The valid value range is [0, 10]. + # @!attribute [rw] lifecycle_policies + # @return [::Array<::Google::Cloud::Batch::V1::LifecyclePolicy>] + # Lifecycle management schema when any task in a task group is failed. + # Currently we only support one lifecycle policy. + # When the lifecycle policy condition is met, + # the action in the policy will execute. + # If task execution result does not meet with the defined lifecycle + # policy, we consider it as the default policy. + # Default policy means if the exit code is 0, exit task. + # If task ends with non-zero exit code, retry the task with max_retry_count. + # @!attribute [rw] environments + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Protobuf::Map{::String => ::String}] + # Deprecated: please use environment(non-plural) instead. + # @!attribute [rw] volumes + # @return [::Array<::Google::Cloud::Batch::V1::Volume>] + # Volumes to mount before running Tasks using this TaskSpec. + # @!attribute [rw] environment + # @return [::Google::Cloud::Batch::V1::Environment] + # Environment variables to set before running the Task. + class TaskSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class EnvironmentsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # LifecyclePolicy describes how to deal with task failures + # based on different conditions. + # @!attribute [rw] action + # @return [::Google::Cloud::Batch::V1::LifecyclePolicy::Action] + # Action to execute when ActionCondition is true. + # When RETRY_TASK is specified, we will retry failed tasks + # if we notice any exit code match and fail tasks if no match is found. + # Likewise, when FAIL_TASK is specified, we will fail tasks + # if we notice any exit code match and retry tasks if no match is found. + # @!attribute [rw] action_condition + # @return [::Google::Cloud::Batch::V1::LifecyclePolicy::ActionCondition] + # Conditions that decide why a task failure is dealt with a specific action. + class LifecyclePolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Conditions for actions to deal with task failures. + # @!attribute [rw] exit_codes + # @return [::Array<::Integer>] + # Exit codes of a task execution. + # If there are more than 1 exit codes, + # when task executes with any of the exit code in the list, + # the condition is met and the action will be executed. + class ActionCondition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Action on task failures based on different conditions. + module Action + # Action unspecified. + ACTION_UNSPECIFIED = 0 + + # Action that tasks in the group will be scheduled to re-execute. + RETRY_TASK = 1 + + # Action that tasks in the group will be stopped immediately. + FAIL_TASK = 2 + end + end + + # A Cloud Batch task. + # @!attribute [rw] name + # @return [::String] + # Task name. + # The name is generated from the parent TaskGroup name and 'id' field. + # For example: + # "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". + # @!attribute [rw] status + # @return [::Google::Cloud::Batch::V1::TaskStatus] + # Task Status. + class Task + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An Environment describes a collection of environment variables to set when + # executing Tasks. + # @!attribute [rw] variables + # @return [::Google::Protobuf::Map{::String => ::String}] + # A map of environment variable names to values. + # @!attribute [rw] secret_variables + # @return [::Google::Protobuf::Map{::String => ::String}] + # A map of environment variable names to Secret Manager secret names. + # The VM will access the named secrets to set the value of each environment + # variable. + # @!attribute [rw] encrypted_variables + # @return [::Google::Cloud::Batch::V1::Environment::KMSEnvMap] + # An encrypted JSON dictionary where the key/value pairs correspond to + # environment variable names and their values. + class Environment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key_name + # @return [::String] + # The name of the KMS key that will be used to decrypt the cipher text. + # @!attribute [rw] cipher_text + # @return [::String] + # The value of the cipherText response from the `encrypt` method. + class KMSEnvMap + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class VariablesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class SecretVariablesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/volume.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/volume.rb new file mode 100644 index 000000000000..9b0dbb7172d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/volume.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Batch + module V1 + # Volume describes a volume and parameters for it to be mounted to a VM. + # @!attribute [rw] nfs + # @return [::Google::Cloud::Batch::V1::NFS] + # A Network File System (NFS) volume. For example, a + # Filestore file share. + # @!attribute [rw] gcs + # @return [::Google::Cloud::Batch::V1::GCS] + # A Google Cloud Storage (GCS) volume. + # @!attribute [rw] device_name + # @return [::String] + # Device name of an attached disk volume, which should align with a + # device_name specified by + # job.allocation_policy.instances[0].policy.disks[i].device_name or + # defined by the given instance template in + # job.allocation_policy.instances[0].instance_template. + # @!attribute [rw] mount_path + # @return [::String] + # The mount path for the volume, e.g. /mnt/disks/share. + # @!attribute [rw] mount_options + # @return [::Array<::String>] + # Mount options vary based on the type of storage volume: + # + # * For a Cloud Storage bucket, all the mount options provided + # by + # the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) + # are supported. + # * For an existing persistent disk, all mount options provided by the + # [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) + # except writing are supported. This is due to restrictions of + # [multi-writer + # mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). + # * For any other disk or a Network File System (NFS), all the + # mount options provided by the `mount` command are supported. + class Volume + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents an NFS volume. + # @!attribute [rw] server + # @return [::String] + # The IP address of the NFS. + # @!attribute [rw] remote_path + # @return [::String] + # Remote source path exported from the NFS, e.g., "/share". + class NFS + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a Google Cloud Storage volume. + # @!attribute [rw] remote_path + # @return [::String] + # Remote path, either a bucket name or a subdirectory of a bucket, e.g.: + # bucket_name, bucket_name/subdirectory/ + class GCS + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..3729ce6dfaa5 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..d762967fa7ec --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..a916fb4322c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # {::Google::Iam::V1::Binding#members Binding.members}. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..54b83fb82b7d --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,164 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal response of the operation in case of success. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc LongRunningRecognize(LongRunningRecognizeRequest) + # returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "LongRunningRecognizeResponse" + # metadata_type: "LongRunningRecognizeMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..fb4d6862eac9 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `Any` contains an arbitrary serialized protocol buffer message along with a + # URL that describes the type of the serialized message. + # + # Protobuf library provides support to pack/unpack Any values in the form + # of utility functions or additional generated methods of the Any type. + # + # Example 1: Pack and unpack a message in C++. + # + # Foo foo = ...; + # Any any; + # any.PackFrom(foo); + # ... + # if (any.UnpackTo(&foo)) { + # ... + # } + # + # Example 2: Pack and unpack a message in Java. + # + # Foo foo = ...; + # Any any = Any.pack(foo); + # ... + # if (any.is(Foo.class)) { + # foo = any.unpack(Foo.class); + # } + # // or ... + # if (any.isSameTypeAs(Foo.getDefaultInstance())) { + # foo = any.unpack(Foo.getDefaultInstance()); + # } + # + # Example 3: Pack and unpack a message in Python. + # + # foo = Foo(...) + # any = Any() + # any.Pack(foo) + # ... + # if any.Is(Foo.DESCRIPTOR): + # any.Unpack(foo) + # ... + # + # Example 4: Pack and unpack a message in Go + # + # foo := &pb.Foo{...} + # any, err := anypb.New(foo) + # if err != nil { + # ... + # } + # ... + # foo := &pb.Foo{} + # if err := any.UnmarshalTo(foo); err != nil { + # ... + # } + # + # The pack methods provided by protobuf library will by default use + # 'type.googleapis.com/full.type.name' as the type URL and the unpack + # methods only use the fully qualified type name after the last '/' + # in the type URL, for example "foo.bar.com/x/y.z" will yield type + # name "y.z". + # + # JSON + # ==== + # The JSON representation of an `Any` value uses the regular + # representation of the deserialized, embedded message, with an + # additional field `@type` which contains the type URL. Example: + # + # package google.profile; + # message Person { + # string first_name = 1; + # string last_name = 2; + # } + # + # { + # "@type": "type.googleapis.com/google.profile.Person", + # "firstName": , + # "lastName": + # } + # + # If the embedded message type is well-known and has a custom JSON + # representation, that representation will be embedded adding a field + # `value` which holds the custom JSON in addition to the `@type` + # field. Example (for message [google.protobuf.Duration][]): + # + # { + # "@type": "type.googleapis.com/google.protobuf.Duration", + # "value": "1.212s" + # } + # @!attribute [rw] type_url + # @return [::String] + # A URL/resource name that uniquely identifies the type of the serialized + # protocol buffer message. This string must contain at least + # one "/" character. The last segment of the URL's path must represent + # the fully qualified name of the type (as in + # `path/google.protobuf.Duration`). The name should be in a canonical form + # (e.g., leading "." is not accepted). + # + # In practice, teams usually precompile into the binary all types that they + # expect it to use in the context of Any. However, for URLs which use the + # scheme `http`, `https`, or no scheme, one can optionally set up a type + # server that maps type URLs to message definitions as follows: + # + # * If no scheme is provided, `https` is assumed. + # * An HTTP GET on the URL must yield a [google.protobuf.Type][] + # value in binary format, or produce an error. + # * Applications are allowed to cache lookup results based on the + # URL, or have them precompiled into a binary to avoid any + # lookup. Therefore, binary compatibility needs to be preserved + # on changes to types. (Use versioned type names to manage + # breaking changes.) + # + # Note: this functionality is not currently available in the official + # protobuf release, and it is not used for type URLs beginning with + # type.googleapis.com. As of May 2023, there are no widely used type server + # implementations and no plans to implement one. + # + # Schemes other than `http`, `https` (or the empty scheme) might be + # used with implementation specific semantics. + # @!attribute [rw] value + # @return [::String] + # Must be a valid serialized protocol buffer of the above specified type. + class Any + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..b5731a824060 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..8c6b19d52e3d --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # + # service Foo { + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # } + class Empty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..8e7abcf8f052 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..4ac9c4801a3f --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Timestamp represents a point in time independent of any time zone or local + # calendar, encoded as a count of seconds and fractions of seconds at + # nanosecond resolution. The count is relative to an epoch at UTC midnight on + # January 1, 1970, in the proleptic Gregorian calendar which extends the + # Gregorian calendar backwards to year one. + # + # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + # second table is needed for interpretation, using a [24-hour linear + # smear](https://developers.google.com/time/smear). + # + # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + # restricting to that range, we ensure that we can convert to and from [RFC + # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + # + # # Examples + # + # Example 1: Compute Timestamp from POSIX `time()`. + # + # Timestamp timestamp; + # timestamp.set_seconds(time(NULL)); + # timestamp.set_nanos(0); + # + # Example 2: Compute Timestamp from POSIX `gettimeofday()`. + # + # struct timeval tv; + # gettimeofday(&tv, NULL); + # + # Timestamp timestamp; + # timestamp.set_seconds(tv.tv_sec); + # timestamp.set_nanos(tv.tv_usec * 1000); + # + # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + # + # FILETIME ft; + # GetSystemTimeAsFileTime(&ft); + # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + # + # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + # Timestamp timestamp; + # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + # + # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + # + # long millis = System.currentTimeMillis(); + # + # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + # .setNanos((int) ((millis % 1000) * 1000000)).build(); + # + # Example 5: Compute Timestamp from Java `Instant.now()`. + # + # Instant now = Instant.now(); + # + # Timestamp timestamp = + # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + # .setNanos(now.getNano()).build(); + # + # Example 6: Compute Timestamp from current time in Python. + # + # timestamp = Timestamp() + # timestamp.GetCurrentTime() + # + # # JSON Mapping + # + # In JSON format, the Timestamp type is encoded as a string in the + # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" + # where \\{year} is always expressed using four digits while \\{month}, \\{day}, + # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional + # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + # is required. A proto3 JSON serializer should always use UTC (as indicated by + # "Z") when printing the Timestamp type and a proto3 JSON parser should be + # able to accept both UTC and other timezones (as indicated by an offset). + # + # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + # 01:30 UTC on January 15, 2017. + # + # In JavaScript, one can convert a Date object to this format using the + # standard + # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + # method. In Python, a standard `datetime.datetime` object can be converted + # to this format using + # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + # the Joda Time's [`ISODateTimeFormat.dateTime()`]( + # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + # ) to obtain a formatter capable of generating timestamps in this format. + # @!attribute [rw] seconds + # @return [::Integer] + # Represents seconds of UTC time since Unix epoch + # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + # 9999-12-31T23:59:59Z inclusive. + # @!attribute [rw] nanos + # @return [::Integer] + # Non-negative fractions of a second at nanosecond resolution. Negative + # second values with fractions must still have non-negative nanos values + # that count forward in time. Must be from 0 to 999,999,999 + # inclusive. + class Timestamp + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..09acc69b6125 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The `Status` type defines a logical error model that is suitable for + # different programming environments, including REST APIs and RPC APIs. It is + # used by [gRPC](https://github.com/grpc). Each `Status` message contains + # three pieces of data: error code, error message, and error details. + # + # You can find out more about this error model and how to work with it in the + # [API Design Guide](https://cloud.google.com/apis/design/errors). + # @!attribute [rw] code + # @return [::Integer] + # The status code, which should be an enum value of + # [google.rpc.Code][google.rpc.Code]. + # @!attribute [rw] message + # @return [::String] + # A developer-facing error message, which should be in English. Any + # user-facing error message should be localized and sent in the + # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized + # by the client. + # @!attribute [rw] details + # @return [::Array<::Google::Protobuf::Any>] + # A list of messages that carry the error details. There is a common set of + # message types for APIs to use. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..41c8c3a565cc --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-batch-v1/snippets/Gemfile new file mode 100644 index 000000000000..2dda4750a429 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-batch-v1", path: "../" +else + gem "google-cloud-batch-v1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/create_job.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/create_job.rb new file mode 100644 index 000000000000..cdf1aa512b45 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/create_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START batch_v1_generated_BatchService_CreateJob_sync] +require "google/cloud/batch/v1" + +## +# Snippet for the create_job call in the BatchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Batch::V1::BatchService::Client#create_job. +# +def create_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Batch::V1::BatchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Batch::V1::CreateJobRequest.new + + # Call the create_job method. + result = client.create_job request + + # The returned object is of type Google::Cloud::Batch::V1::Job. + p result +end +# [END batch_v1_generated_BatchService_CreateJob_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/delete_job.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/delete_job.rb new file mode 100644 index 000000000000..14554d2ae4ec --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/delete_job.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START batch_v1_generated_BatchService_DeleteJob_sync] +require "google/cloud/batch/v1" + +## +# Snippet for the delete_job call in the BatchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Batch::V1::BatchService::Client#delete_job. +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Batch::V1::BatchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Batch::V1::DeleteJobRequest.new + + # Call the delete_job method. + result = client.delete_job request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END batch_v1_generated_BatchService_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/get_job.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/get_job.rb new file mode 100644 index 000000000000..2041b46cd1c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/get_job.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START batch_v1_generated_BatchService_GetJob_sync] +require "google/cloud/batch/v1" + +## +# Snippet for the get_job call in the BatchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Batch::V1::BatchService::Client#get_job. +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Batch::V1::BatchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Batch::V1::GetJobRequest.new + + # Call the get_job method. + result = client.get_job request + + # The returned object is of type Google::Cloud::Batch::V1::Job. + p result +end +# [END batch_v1_generated_BatchService_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/get_task.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/get_task.rb new file mode 100644 index 000000000000..8b0e54ac3ad6 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/get_task.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START batch_v1_generated_BatchService_GetTask_sync] +require "google/cloud/batch/v1" + +## +# Snippet for the get_task call in the BatchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Batch::V1::BatchService::Client#get_task. +# +def get_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Batch::V1::BatchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Batch::V1::GetTaskRequest.new + + # Call the get_task method. + result = client.get_task request + + # The returned object is of type Google::Cloud::Batch::V1::Task. + p result +end +# [END batch_v1_generated_BatchService_GetTask_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/list_jobs.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/list_jobs.rb new file mode 100644 index 000000000000..b1e377cb6aa9 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/list_jobs.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START batch_v1_generated_BatchService_ListJobs_sync] +require "google/cloud/batch/v1" + +## +# Snippet for the list_jobs call in the BatchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Batch::V1::BatchService::Client#list_jobs. +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Batch::V1::BatchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Batch::V1::ListJobsRequest.new + + # Call the list_jobs method. + result = client.list_jobs request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Batch::V1::Job. + p item + end +end +# [END batch_v1_generated_BatchService_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/list_tasks.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/list_tasks.rb new file mode 100644 index 000000000000..f4fd01b5441c --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/list_tasks.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START batch_v1_generated_BatchService_ListTasks_sync] +require "google/cloud/batch/v1" + +## +# Snippet for the list_tasks call in the BatchService service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Cloud::Batch::V1::BatchService::Client#list_tasks. +# +def list_tasks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Batch::V1::BatchService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Batch::V1::ListTasksRequest.new + + # Call the list_tasks method. + result = client.list_tasks request + + # The returned object is of type Gapic::PagedEnumerable. You can iterate + # over elements, and API calls will be issued to fetch pages as needed. + result.each do |item| + # Each element is of type ::Google::Cloud::Batch::V1::Task. + p item + end +end +# [END batch_v1_generated_BatchService_ListTasks_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/get_iam_policy.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/get_iam_policy.rb new file mode 100644 index 000000000000..9ae1021a14c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START batch_v1_generated_IAMPolicy_GetIamPolicy_sync] +require "google/iam/v1" + +## +# Snippet for the get_iam_policy call in the IAMPolicy service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V1::IAMPolicy::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1::IAMPolicy::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END batch_v1_generated_IAMPolicy_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/set_iam_policy.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/set_iam_policy.rb new file mode 100644 index 000000000000..03dc4613ea22 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START batch_v1_generated_IAMPolicy_SetIamPolicy_sync] +require "google/iam/v1" + +## +# Snippet for the set_iam_policy call in the IAMPolicy service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V1::IAMPolicy::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1::IAMPolicy::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END batch_v1_generated_IAMPolicy_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/test_iam_permissions.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/test_iam_permissions.rb new file mode 100644 index 000000000000..3d9d72aae7e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START batch_v1_generated_IAMPolicy_TestIamPermissions_sync] +require "google/iam/v1" + +## +# Snippet for the test_iam_permissions call in the IAMPolicy service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V1::IAMPolicy::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1::IAMPolicy::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END batch_v1_generated_IAMPolicy_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/snippet_metadata_google.cloud.batch.v1.json b/owl-bot-staging/google-cloud-batch-v1/snippets/snippet_metadata_google.cloud.batch.v1.json new file mode 100644 index 000000000000..56107aaba8e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/snippets/snippet_metadata_google.cloud.batch.v1.json @@ -0,0 +1,255 @@ +{ + "client_library": { + "name": "google-cloud-batch-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.batch.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "batch_v1_generated_BatchService_CreateJob_sync", + "title": "Snippet for the create_job call in the BatchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Batch::V1::BatchService::Client#create_job.", + "file": "batch_service/create_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_job", + "full_name": "::Google::Cloud::Batch::V1::BatchService::Client#create_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Batch::V1::CreateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Batch::V1::Job", + "client": { + "short_name": "BatchService::Client", + "full_name": "::Google::Cloud::Batch::V1::BatchService::Client" + }, + "method": { + "short_name": "CreateJob", + "full_name": "google.cloud.batch.v1.BatchService.CreateJob", + "service": { + "short_name": "BatchService", + "full_name": "google.cloud.batch.v1.BatchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "batch_v1_generated_BatchService_GetJob_sync", + "title": "Snippet for the get_job call in the BatchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Batch::V1::BatchService::Client#get_job.", + "file": "batch_service/get_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_job", + "full_name": "::Google::Cloud::Batch::V1::BatchService::Client#get_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Batch::V1::GetJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Batch::V1::Job", + "client": { + "short_name": "BatchService::Client", + "full_name": "::Google::Cloud::Batch::V1::BatchService::Client" + }, + "method": { + "short_name": "GetJob", + "full_name": "google.cloud.batch.v1.BatchService.GetJob", + "service": { + "short_name": "BatchService", + "full_name": "google.cloud.batch.v1.BatchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "batch_v1_generated_BatchService_DeleteJob_sync", + "title": "Snippet for the delete_job call in the BatchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Batch::V1::BatchService::Client#delete_job.", + "file": "batch_service/delete_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_job", + "full_name": "::Google::Cloud::Batch::V1::BatchService::Client#delete_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Batch::V1::DeleteJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "BatchService::Client", + "full_name": "::Google::Cloud::Batch::V1::BatchService::Client" + }, + "method": { + "short_name": "DeleteJob", + "full_name": "google.cloud.batch.v1.BatchService.DeleteJob", + "service": { + "short_name": "BatchService", + "full_name": "google.cloud.batch.v1.BatchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "batch_v1_generated_BatchService_ListJobs_sync", + "title": "Snippet for the list_jobs call in the BatchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Batch::V1::BatchService::Client#list_jobs.", + "file": "batch_service/list_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_jobs", + "full_name": "::Google::Cloud::Batch::V1::BatchService::Client#list_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Batch::V1::ListJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Batch::V1::ListJobsResponse", + "client": { + "short_name": "BatchService::Client", + "full_name": "::Google::Cloud::Batch::V1::BatchService::Client" + }, + "method": { + "short_name": "ListJobs", + "full_name": "google.cloud.batch.v1.BatchService.ListJobs", + "service": { + "short_name": "BatchService", + "full_name": "google.cloud.batch.v1.BatchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "batch_v1_generated_BatchService_GetTask_sync", + "title": "Snippet for the get_task call in the BatchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Batch::V1::BatchService::Client#get_task.", + "file": "batch_service/get_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_task", + "full_name": "::Google::Cloud::Batch::V1::BatchService::Client#get_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Batch::V1::GetTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Batch::V1::Task", + "client": { + "short_name": "BatchService::Client", + "full_name": "::Google::Cloud::Batch::V1::BatchService::Client" + }, + "method": { + "short_name": "GetTask", + "full_name": "google.cloud.batch.v1.BatchService.GetTask", + "service": { + "short_name": "BatchService", + "full_name": "google.cloud.batch.v1.BatchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "batch_v1_generated_BatchService_ListTasks_sync", + "title": "Snippet for the list_tasks call in the BatchService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Batch::V1::BatchService::Client#list_tasks.", + "file": "batch_service/list_tasks.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tasks", + "full_name": "::Google::Cloud::Batch::V1::BatchService::Client#list_tasks", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Batch::V1::ListTasksRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Batch::V1::ListTasksResponse", + "client": { + "short_name": "BatchService::Client", + "full_name": "::Google::Cloud::Batch::V1::BatchService::Client" + }, + "method": { + "short_name": "ListTasks", + "full_name": "google.cloud.batch.v1.BatchService.ListTasks", + "service": { + "short_name": "BatchService", + "full_name": "google.cloud.batch.v1.BatchService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/snippet_metadata_google.iam.v1.json b/owl-bot-staging/google-cloud-batch-v1/snippets/snippet_metadata_google.iam.v1.json new file mode 100644 index 000000000000..8e7486b5b5d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/snippets/snippet_metadata_google.iam.v1.json @@ -0,0 +1,135 @@ +{ + "client_library": { + "name": "google-cloud-batch-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.iam.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "batch_v1_generated_IAMPolicy_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the IAMPolicy service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#set_iam_policy.", + "file": "iam_policy/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Iam::V1::IAMPolicy::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "IAMPolicy::Client", + "full_name": "::Google::Iam::V1::IAMPolicy::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.iam.v1.IAMPolicy.SetIamPolicy", + "service": { + "short_name": "IAMPolicy", + "full_name": "google.iam.v1.IAMPolicy" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "batch_v1_generated_IAMPolicy_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the IAMPolicy service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#get_iam_policy.", + "file": "iam_policy/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Iam::V1::IAMPolicy::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "IAMPolicy::Client", + "full_name": "::Google::Iam::V1::IAMPolicy::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.iam.v1.IAMPolicy.GetIamPolicy", + "service": { + "short_name": "IAMPolicy", + "full_name": "google.iam.v1.IAMPolicy" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "batch_v1_generated_IAMPolicy_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the IAMPolicy service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#test_iam_permissions.", + "file": "iam_policy/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Iam::V1::IAMPolicy::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "IAMPolicy::Client", + "full_name": "::Google::Iam::V1::IAMPolicy::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.iam.v1.IAMPolicy.TestIamPermissions", + "service": { + "short_name": "IAMPolicy", + "full_name": "google.iam.v1.IAMPolicy" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_operations_test.rb b/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_operations_test.rb new file mode 100644 index 000000000000..1e03eb9e611f --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_operations_test.rb @@ -0,0 +1,389 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/batch/v1/batch_pb" +require "google/cloud/batch/v1/batch_services_pb" +require "google/cloud/batch/v1/batch_service" + +class ::Google::Cloud::Batch::V1::BatchService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Batch::V1::BatchService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Batch::V1::BatchService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_paths_test.rb b/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_paths_test.rb new file mode 100644 index 000000000000..f1db8831652d --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_paths_test.rb @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/batch/v1/batch_service" + +class ::Google::Cloud::Batch::V1::BatchService::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_job_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.job_path project: "value0", location: "value1", job: "value2" + assert_equal "projects/value0/locations/value1/jobs/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_task_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.task_path project: "value0", location: "value1", job: "value2", task_group: "value3", task: "value4" + assert_equal "projects/value0/locations/value1/jobs/value2/taskGroups/value3/tasks/value4", path + end + end + + def test_task_group_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.task_group_path project: "value0", location: "value1", job: "value2", task_group: "value3" + assert_equal "projects/value0/locations/value1/jobs/value2/taskGroups/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_rest_test.rb b/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_rest_test.rb new file mode 100644 index 000000000000..5859fdf8a5ee --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_rest_test.rb @@ -0,0 +1,427 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/cloud/batch/v1/batch_pb" +require "google/cloud/batch/v1/batch_service/rest" + + +class ::Google::Cloud::Batch::V1::BatchService::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_job + # Create test objects. + client_result = ::Google::Cloud::Batch::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + job_id = "hello world" + job = {} + request_id = "hello world" + + create_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Batch::V1::BatchService::Rest::ServiceStub.stub :transcode_create_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_job({ parent: parent, job_id: job_id, job: job, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_job parent: parent, job_id: job_id, job: job, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_job ::Google::Cloud::Batch::V1::CreateJobRequest.new(parent: parent, job_id: job_id, job: job, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_job({ parent: parent, job_id: job_id, job: job, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_job(::Google::Cloud::Batch::V1::CreateJobRequest.new(parent: parent, job_id: job_id, job: job, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_job_client_stub.call_count + end + end + end + + def test_get_job + # Create test objects. + client_result = ::Google::Cloud::Batch::V1::Job.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Batch::V1::BatchService::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_job ::Google::Cloud::Batch::V1::GetJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::Batch::V1::GetJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_job_client_stub.call_count + end + end + end + + def test_delete_job + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + reason = "hello world" + request_id = "hello world" + + delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Batch::V1::BatchService::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_job({ name: name, reason: reason, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_job name: name, reason: reason, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Batch::V1::DeleteJobRequest.new(name: name, reason: reason, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_job({ name: name, reason: reason, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_job(::Google::Cloud::Batch::V1::DeleteJobRequest.new(name: name, reason: reason, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_job_client_stub.call_count + end + end + end + + def test_list_jobs + # Create test objects. + client_result = ::Google::Cloud::Batch::V1::ListJobsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + order_by = "hello world" + page_size = 42 + page_token = "hello world" + + list_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Batch::V1::BatchService::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_jobs({ parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_jobs parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_jobs ::Google::Cloud::Batch::V1::ListJobsRequest.new(parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_jobs({ parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_jobs(::Google::Cloud::Batch::V1::ListJobsRequest.new(parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_jobs_client_stub.call_count + end + end + end + + def test_get_task + # Create test objects. + client_result = ::Google::Cloud::Batch::V1::Task.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Batch::V1::BatchService::Rest::ServiceStub.stub :transcode_get_task_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_task_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_task({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_task name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_task ::Google::Cloud::Batch::V1::GetTaskRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_task({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_task(::Google::Cloud::Batch::V1::GetTaskRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_task_client_stub.call_count + end + end + end + + def test_list_tasks + # Create test objects. + client_result = ::Google::Cloud::Batch::V1::ListTasksResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_tasks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Batch::V1::BatchService::Rest::ServiceStub.stub :transcode_list_tasks_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_tasks_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_tasks({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_tasks parent: parent, filter: filter, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_tasks ::Google::Cloud::Batch::V1::ListTasksRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_tasks({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_tasks(::Google::Cloud::Batch::V1::ListTasksRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_tasks_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Batch::V1::BatchService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_test.rb b/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_test.rb new file mode 100644 index 000000000000..f936451a090e --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_test.rb @@ -0,0 +1,477 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/batch/v1/batch_pb" +require "google/cloud/batch/v1/batch_services_pb" +require "google/cloud/batch/v1/batch_service" + +class ::Google::Cloud::Batch::V1::BatchService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_create_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Batch::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + job_id = "hello world" + job = {} + request_id = "hello world" + + create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_job, name + assert_kind_of ::Google::Cloud::Batch::V1::CreateJobRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["job_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Batch::V1::Job), request["job"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_job({ parent: parent, job_id: job_id, job: job, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_job parent: parent, job_id: job_id, job: job, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_job ::Google::Cloud::Batch::V1::CreateJobRequest.new(parent: parent, job_id: job_id, job: job, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_job({ parent: parent, job_id: job_id, job: job, request_id: request_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_job(::Google::Cloud::Batch::V1::CreateJobRequest.new(parent: parent, job_id: job_id, job: job, request_id: request_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_job_client_stub.call_rpc_count + end + end + + def test_get_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Batch::V1::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_job, name + assert_kind_of ::Google::Cloud::Batch::V1::GetJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_job ::Google::Cloud::Batch::V1::GetJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::Batch::V1::GetJobRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_job_client_stub.call_rpc_count + end + end + + def test_delete_job + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + reason = "hello world" + request_id = "hello world" + + delete_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_job, name + assert_kind_of ::Google::Cloud::Batch::V1::DeleteJobRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["reason"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_job({ name: name, reason: reason, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_job name: name, reason: reason, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Batch::V1::DeleteJobRequest.new(name: name, reason: reason, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_job({ name: name, reason: reason, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_job(::Google::Cloud::Batch::V1::DeleteJobRequest.new(name: name, reason: reason, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_job_client_stub.call_rpc_count + end + end + + def test_list_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Batch::V1::ListJobsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + order_by = "hello world" + page_size = 42 + page_token = "hello world" + + list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_jobs, name + assert_kind_of ::Google::Cloud::Batch::V1::ListJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_jobs({ parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_jobs parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_jobs ::Google::Cloud::Batch::V1::ListJobsRequest.new(parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_jobs({ parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_jobs(::Google::Cloud::Batch::V1::ListJobsRequest.new(parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_jobs_client_stub.call_rpc_count + end + end + + def test_get_task + # Create GRPC objects. + grpc_response = ::Google::Cloud::Batch::V1::Task.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_task, name + assert_kind_of ::Google::Cloud::Batch::V1::GetTaskRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_task_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_task({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_task name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_task ::Google::Cloud::Batch::V1::GetTaskRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_task({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_task(::Google::Cloud::Batch::V1::GetTaskRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_task_client_stub.call_rpc_count + end + end + + def test_list_tasks + # Create GRPC objects. + grpc_response = ::Google::Cloud::Batch::V1::ListTasksResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_tasks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tasks, name + assert_kind_of ::Google::Cloud::Batch::V1::ListTasksRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_tasks_client_stub do + # Create client + client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_tasks({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_tasks parent: parent, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_tasks ::Google::Cloud::Batch::V1::ListTasksRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_tasks({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_tasks(::Google::Cloud::Batch::V1::ListTasksRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_tasks_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Batch::V1::BatchService::Client::Configuration, config + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Batch::V1::BatchService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/test/google/iam/v1/iam_policy_rest_test.rb b/owl-bot-staging/google-cloud-batch-v1/test/google/iam/v1/iam_policy_rest_test.rb new file mode 100644 index 000000000000..da6f78f3716b --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/test/google/iam/v1/iam_policy_rest_test.rb @@ -0,0 +1,257 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/iam/v1/iam_policy_pb" +require "google/iam/v1/iam_policy/rest" + + +class ::Google::Iam::V1::IAMPolicy::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {} + make_http_request :get, uri: uri, body: nil, params: params, options: options + end + + def make_delete_request uri:, params: {}, options: {} + make_http_request :delete, uri: uri, body: nil, params: params, options: options + end + + def make_post_request uri:, body: nil, params: {}, options: {} + make_http_request :post, uri: uri, body: body, params: params, options: options + end + + def make_patch_request uri:, body:, params: {}, options: {} + make_http_request :patch, uri: uri, body: body, params: params, options: options + end + + def make_put_request uri:, body:, params: {}, options: {} + make_http_request :put, uri: uri, body: body, params: params, options: options + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Iam::V1::IAMPolicy::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/test/google/iam/v1/iam_policy_test.rb b/owl-bot-staging/google-cloud-batch-v1/test/google/iam/v1/iam_policy_test.rb new file mode 100644 index 000000000000..956f5832d339 --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/test/google/iam/v1/iam_policy_test.rb @@ -0,0 +1,258 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/iam/v1/iam_policy_pb" +require "google/iam/v1/iam_policy_services_pb" +require "google/iam/v1/iam_policy" + +class ::Google::Iam::V1::IAMPolicy::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Iam::V1::IAMPolicy::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-batch-v1/test/helper.rb b/owl-bot-staging/google-cloud-batch-v1/test/helper.rb new file mode 100644 index 000000000000..48407bca7edb --- /dev/null +++ b/owl-bot-staging/google-cloud-batch-v1/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From 09e59987fe64032ff16dd35c4378f6757cf797f3 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 3 Sep 2024 11:57:02 +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/batch/v1/job_pb.rb | 2 +- .../proto_docs/google/cloud/batch/v1/job.rb | 19 + .../google-cloud-batch-v1/.gitignore | 22 - .../google-cloud-batch-v1/.repo-metadata.json | 15 - .../google-cloud-batch-v1/.rubocop.yml | 33 - .../google-cloud-batch-v1/.toys.rb | 28 - .../google-cloud-batch-v1/.yardopts | 12 - .../google-cloud-batch-v1/AUTHENTICATION.md | 122 -- .../google-cloud-batch-v1/CHANGELOG.md | 2 - owl-bot-staging/google-cloud-batch-v1/Gemfile | 11 - .../google-cloud-batch-v1/LICENSE.md | 201 ---- .../google-cloud-batch-v1/README.md | 141 --- .../google-cloud-batch-v1/Rakefile | 169 --- .../google-cloud-batch-v1/gapic_metadata.json | 48 - .../google-cloud-batch-v1.gemspec | 30 - .../lib/google-cloud-batch-v1.rb | 22 - .../lib/google/cloud/batch/v1.rb | 45 - .../lib/google/cloud/batch/v1/batch_pb.rb | 64 - .../google/cloud/batch/v1/batch_service.rb | 58 - .../cloud/batch/v1/batch_service/client.rb | 1025 ----------------- .../batch/v1/batch_service/credentials.rb | 47 - .../batch/v1/batch_service/operations.rb | 809 ------------- .../cloud/batch/v1/batch_service/paths.rb | 113 -- .../cloud/batch/v1/batch_service/rest.rb | 56 - .../batch/v1/batch_service/rest/client.rb | 963 ---------------- .../batch/v1/batch_service/rest/operations.rb | 902 --------------- .../v1/batch_service/rest/service_stub.rb | 424 ------- .../cloud/batch/v1/batch_services_pb.rb | 57 - .../cloud/batch/v1/bindings_override.rb | 102 -- .../lib/google/cloud/batch/v1/job_pb.rb | 75 -- .../lib/google/cloud/batch/v1/rest.rb | 38 - .../lib/google/cloud/batch/v1/task_pb.rb | 66 -- .../lib/google/cloud/batch/v1/version.rb | 28 - .../lib/google/cloud/batch/v1/volume_pb.rb | 44 - .../lib/google/iam/v1.rb | 43 - .../lib/google/iam/v1/bindings_override.rb | 100 -- .../lib/google/iam/v1/iam_policy.rb | 77 -- .../lib/google/iam/v1/iam_policy/client.rb | 680 ----------- .../google/iam/v1/iam_policy/credentials.rb | 42 - .../lib/google/iam/v1/iam_policy/rest.rb | 75 -- .../google/iam/v1/iam_policy/rest/client.rb | 641 ----------- .../iam/v1/iam_policy/rest/service_stub.rb | 247 ---- .../lib/google/iam/v1/rest.rb | 36 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 420 ------- .../proto_docs/google/api/field_behavior.rb | 85 -- .../proto_docs/google/api/field_info.rb | 88 -- .../proto_docs/google/api/launch_stage.rb | 71 -- .../proto_docs/google/api/resource.rb | 227 ---- .../proto_docs/google/cloud/batch/v1/batch.rb | 215 ---- .../proto_docs/google/cloud/batch/v1/job.rb | 743 ------------ .../proto_docs/google/cloud/batch/v1/task.rb | 537 --------- .../google/cloud/batch/v1/volume.rb | 86 -- .../proto_docs/google/iam/v1/iam_policy.rb | 87 -- .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 ------- .../google/longrunning/operations.rb | 164 --- .../proto_docs/google/protobuf/any.rb | 145 --- .../proto_docs/google/protobuf/duration.rb | 98 -- .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 ---- .../proto_docs/google/protobuf/timestamp.rb | 127 -- .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 -- .../google-cloud-batch-v1/snippets/Gemfile | 32 - .../snippets/batch_service/create_job.rb | 47 - .../snippets/batch_service/delete_job.rb | 54 - .../snippets/batch_service/get_job.rb | 47 - .../snippets/batch_service/get_task.rb | 47 - .../snippets/batch_service/list_jobs.rb | 51 - .../snippets/batch_service/list_tasks.rb | 51 - .../snippets/iam_policy/get_iam_policy.rb | 47 - .../snippets/iam_policy/set_iam_policy.rb | 47 - .../iam_policy/test_iam_permissions.rb | 47 - ...nippet_metadata_google.cloud.batch.v1.json | 255 ---- .../snippet_metadata_google.iam.v1.json | 135 --- .../batch/v1/batch_service_operations_test.rb | 389 ------- .../batch/v1/batch_service_paths_test.rb | 83 -- .../cloud/batch/v1/batch_service_rest_test.rb | 427 ------- .../cloud/batch/v1/batch_service_test.rb | 477 -------- .../google/iam/v1/iam_policy_rest_test.rb | 257 ----- .../test/google/iam/v1/iam_policy_test.rb | 258 ----- .../google-cloud-batch-v1/test/helper.rb | 25 - 83 files changed, 20 insertions(+), 14449 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-batch-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-batch-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-batch-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-batch-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-batch-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-batch-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-batch-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-batch-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-batch-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-batch-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-batch-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-batch-v1/google-cloud-batch-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google-cloud-batch-v1.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_pb.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/job_pb.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/task_pb.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/volume_pb.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/client.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/batch.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/job.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/task.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/volume.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/create_job.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/delete_job.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/get_job.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/get_task.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/list_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/list_tasks.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/snippet_metadata_google.cloud.batch.v1.json delete mode 100644 owl-bot-staging/google-cloud-batch-v1/snippets/snippet_metadata_google.iam.v1.json delete mode 100644 owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/test/google/iam/v1/iam_policy_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/test/google/iam/v1/iam_policy_test.rb delete mode 100644 owl-bot-staging/google-cloud-batch-v1/test/helper.rb diff --git a/google-cloud-batch-v1/lib/google/cloud/batch/v1/job_pb.rb b/google-cloud-batch-v1/lib/google/cloud/batch/v1/job_pb.rb index 5d35e0df358d..c9cc28e4b26b 100644 --- a/google-cloud-batch-v1/lib/google/cloud/batch/v1/job_pb.rb +++ b/google-cloud-batch-v1/lib/google/cloud/batch/v1/job_pb.rb @@ -11,7 +11,7 @@ require 'google/protobuf/timestamp_pb' -descriptor_data = "\n\x1fgoogle/cloud/batch/v1/job.proto\x12\x15google.cloud.batch.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/cloud/batch/v1/task.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x90\x05\n\x03Job\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x08priority\x18\x03 \x01(\x03\x12:\n\x0btask_groups\x18\x04 \x03(\x0b\x32 .google.cloud.batch.v1.TaskGroupB\x03\xe0\x41\x02\x12\x42\n\x11\x61llocation_policy\x18\x07 \x01(\x0b\x32\'.google.cloud.batch.v1.AllocationPolicy\x12\x36\n\x06labels\x18\x08 \x03(\x0b\x32&.google.cloud.batch.v1.Job.LabelsEntry\x12\x35\n\x06status\x18\t \x01(\x0b\x32 .google.cloud.batch.v1.JobStatusB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\x0blogs_policy\x18\r \x01(\x0b\x32!.google.cloud.batch.v1.LogsPolicy\x12=\n\rnotifications\x18\x0e \x03(\x0b\x32&.google.cloud.batch.v1.JobNotification\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:Q\xea\x41N\n\x18\x62\x61tch.googleapis.com/Job\x12\x32projects/{project}/locations/{location}/jobs/{job}\"\xcd\x02\n\nLogsPolicy\x12\x42\n\x0b\x64\x65stination\x18\x01 \x01(\x0e\x32-.google.cloud.batch.v1.LogsPolicy.Destination\x12\x11\n\tlogs_path\x18\x02 \x01(\t\x12W\n\x14\x63loud_logging_option\x18\x03 \x01(\x0b\x32\x34.google.cloud.batch.v1.LogsPolicy.CloudLoggingOptionB\x03\xe0\x41\x01\x1a\x46\n\x12\x43loudLoggingOption\x12\x30\n#use_generic_task_monitored_resource\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"G\n\x0b\x44\x65stination\x12\x1b\n\x17\x44\x45STINATION_UNSPECIFIED\x10\x00\x12\x11\n\rCLOUD_LOGGING\x10\x01\x12\x08\n\x04PATH\x10\x02\"\x80\x07\n\tJobStatus\x12\x35\n\x05state\x18\x01 \x01(\x0e\x32&.google.cloud.batch.v1.JobStatus.State\x12\x39\n\rstatus_events\x18\x02 \x03(\x0b\x32\".google.cloud.batch.v1.StatusEvent\x12\x45\n\x0btask_groups\x18\x04 \x03(\x0b\x32\x30.google.cloud.batch.v1.JobStatus.TaskGroupsEntry\x12/\n\x0crun_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\xd1\x01\n\x0eInstanceStatus\x12\x14\n\x0cmachine_type\x18\x01 \x01(\t\x12U\n\x12provisioning_model\x18\x02 \x01(\x0e\x32\x39.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel\x12\x11\n\ttask_pack\x18\x03 \x01(\x03\x12?\n\tboot_disk\x18\x04 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.Disk\x1a\xd2\x01\n\x0fTaskGroupStatus\x12L\n\x06\x63ounts\x18\x01 \x03(\x0b\x32<.google.cloud.batch.v1.JobStatus.TaskGroupStatus.CountsEntry\x12\x42\n\tinstances\x18\x02 \x03(\x0b\x32/.google.cloud.batch.v1.JobStatus.InstanceStatus\x1a-\n\x0b\x43ountsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x63\n\x0fTaskGroupsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.google.cloud.batch.v1.JobStatus.TaskGroupStatus:\x02\x38\x01\"{\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06QUEUED\x10\x01\x12\r\n\tSCHEDULED\x10\x02\x12\x0b\n\x07RUNNING\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05\x12\x18\n\x14\x44\x45LETION_IN_PROGRESS\x10\x06\"\xfc\x02\n\x0fJobNotification\x12\x14\n\x0cpubsub_topic\x18\x01 \x01(\t\x12?\n\x07message\x18\x02 \x01(\x0b\x32..google.cloud.batch.v1.JobNotification.Message\x1a\xc4\x01\n\x07Message\x12\x39\n\x04type\x18\x01 \x01(\x0e\x32+.google.cloud.batch.v1.JobNotification.Type\x12=\n\rnew_job_state\x18\x02 \x01(\x0e\x32&.google.cloud.batch.v1.JobStatus.State\x12?\n\x0enew_task_state\x18\x03 \x01(\x0e\x32\'.google.cloud.batch.v1.TaskStatus.State\"K\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11JOB_STATE_CHANGED\x10\x01\x12\x16\n\x12TASK_STATE_CHANGED\x10\x02\"\xdc\x0e\n\x10\x41llocationPolicy\x12H\n\x08location\x18\x01 \x01(\x0b\x32\x36.google.cloud.batch.v1.AllocationPolicy.LocationPolicy\x12S\n\tinstances\x18\x08 \x03(\x0b\x32@.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate\x12>\n\x0fservice_account\x18\t \x01(\x0b\x32%.google.cloud.batch.v1.ServiceAccount\x12\x43\n\x06labels\x18\x06 \x03(\x0b\x32\x33.google.cloud.batch.v1.AllocationPolicy.LabelsEntry\x12\x46\n\x07network\x18\x07 \x01(\x0b\x32\x35.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy\x12J\n\tplacement\x18\n \x01(\x0b\x32\x37.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy\x12\x11\n\x04tags\x18\x0b \x03(\tB\x03\xe0\x41\x01\x1a+\n\x0eLocationPolicy\x12\x19\n\x11\x61llowed_locations\x18\x01 \x03(\t\x1aq\n\x04\x44isk\x12\x0f\n\x05image\x18\x04 \x01(\tH\x00\x12\x12\n\x08snapshot\x18\x05 \x01(\tH\x00\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07size_gb\x18\x02 \x01(\x03\x12\x16\n\x0e\x64isk_interface\x18\x06 \x01(\tB\r\n\x0b\x64\x61ta_source\x1a\x8a\x01\n\x0c\x41ttachedDisk\x12@\n\x08new_disk\x18\x01 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.DiskH\x00\x12\x17\n\rexisting_disk\x18\x02 \x01(\tH\x00\x12\x13\n\x0b\x64\x65vice_name\x18\x03 \x01(\tB\n\n\x08\x61ttached\x1ah\n\x0b\x41\x63\x63\x65lerator\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x03\x12\x1f\n\x13install_gpu_drivers\x18\x03 \x01(\x08\x42\x02\x18\x01\x12\x1b\n\x0e\x64river_version\x18\x04 \x01(\tB\x03\xe0\x41\x01\x1a\x82\x03\n\x0eInstancePolicy\x12\x14\n\x0cmachine_type\x18\x02 \x01(\t\x12\x18\n\x10min_cpu_platform\x18\x03 \x01(\t\x12U\n\x12provisioning_model\x18\x04 \x01(\x0e\x32\x39.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel\x12I\n\x0c\x61\x63\x63\x65lerators\x18\x05 \x03(\x0b\x32\x33.google.cloud.batch.v1.AllocationPolicy.Accelerator\x12?\n\tboot_disk\x18\x08 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.Disk\x12\x43\n\x05\x64isks\x18\x06 \x03(\x0b\x32\x34.google.cloud.batch.v1.AllocationPolicy.AttachedDisk\x12\x18\n\x0breservation\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\xd1\x01\n\x18InstancePolicyOrTemplate\x12H\n\x06policy\x18\x01 \x01(\x0b\x32\x36.google.cloud.batch.v1.AllocationPolicy.InstancePolicyH\x00\x12\x1b\n\x11instance_template\x18\x02 \x01(\tH\x00\x12\x1b\n\x13install_gpu_drivers\x18\x03 \x01(\x08\x12\x1e\n\x11install_ops_agent\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x42\x11\n\x0fpolicy_template\x1aW\n\x10NetworkInterface\x12\x0f\n\x07network\x18\x01 \x01(\t\x12\x12\n\nsubnetwork\x18\x02 \x01(\t\x12\x1e\n\x16no_external_ip_address\x18\x03 \x01(\x08\x1a\x65\n\rNetworkPolicy\x12T\n\x12network_interfaces\x18\x01 \x03(\x0b\x32\x38.google.cloud.batch.v1.AllocationPolicy.NetworkInterface\x1a<\n\x0fPlacementPolicy\x12\x13\n\x0b\x63ollocation\x18\x01 \x01(\t\x12\x14\n\x0cmax_distance\x18\x02 \x01(\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"`\n\x11ProvisioningModel\x12\"\n\x1ePROVISIONING_MODEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x08\n\x04SPOT\x10\x02\x12\x0f\n\x0bPREEMPTIBLE\x10\x03\"\xcb\x04\n\tTaskGroup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x37\n\ttask_spec\x18\x03 \x01(\x0b\x32\x1f.google.cloud.batch.v1.TaskSpecB\x03\xe0\x41\x02\x12\x12\n\ntask_count\x18\x04 \x01(\x03\x12\x13\n\x0bparallelism\x18\x05 \x01(\x03\x12L\n\x11scheduling_policy\x18\x06 \x01(\x0e\x32\x31.google.cloud.batch.v1.TaskGroup.SchedulingPolicy\x12=\n\x11task_environments\x18\t \x03(\x0b\x32\".google.cloud.batch.v1.Environment\x12\x1b\n\x13task_count_per_node\x18\n \x01(\x03\x12\x1a\n\x12require_hosts_file\x18\x0b \x01(\x08\x12\x16\n\x0epermissive_ssh\x18\x0c \x01(\x08\x12\x1c\n\x0frun_as_non_root\x18\x0e \x01(\x08\x42\x03\xe0\x41\x01\"\\\n\x10SchedulingPolicy\x12!\n\x1dSCHEDULING_POLICY_UNSPECIFIED\x10\x00\x12\x17\n\x13\x41S_SOON_AS_POSSIBLE\x10\x01\x12\x0c\n\x08IN_ORDER\x10\x02:o\xea\x41l\n\x1e\x62\x61tch.googleapis.com/TaskGroup\x12Jprojects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}\"/\n\x0eServiceAccount\x12\r\n\x05\x65mail\x18\x01 \x01(\t\x12\x0e\n\x06scopes\x18\x02 \x03(\tB\xa9\x01\n\x19\x63om.google.cloud.batch.v1B\x08JobProtoP\x01Z/cloud.google.com/go/batch/apiv1/batchpb;batchpb\xa2\x02\x03GCB\xaa\x02\x15Google.Cloud.Batch.V1\xca\x02\x15Google\\Cloud\\Batch\\V1\xea\x02\x18Google::Cloud::Batch::V1b\x06proto3" +descriptor_data = "\n\x1fgoogle/cloud/batch/v1/job.proto\x12\x15google.cloud.batch.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/cloud/batch/v1/task.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x90\x05\n\x03Job\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x08priority\x18\x03 \x01(\x03\x12:\n\x0btask_groups\x18\x04 \x03(\x0b\x32 .google.cloud.batch.v1.TaskGroupB\x03\xe0\x41\x02\x12\x42\n\x11\x61llocation_policy\x18\x07 \x01(\x0b\x32\'.google.cloud.batch.v1.AllocationPolicy\x12\x36\n\x06labels\x18\x08 \x03(\x0b\x32&.google.cloud.batch.v1.Job.LabelsEntry\x12\x35\n\x06status\x18\t \x01(\x0b\x32 .google.cloud.batch.v1.JobStatusB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\x0blogs_policy\x18\r \x01(\x0b\x32!.google.cloud.batch.v1.LogsPolicy\x12=\n\rnotifications\x18\x0e \x03(\x0b\x32&.google.cloud.batch.v1.JobNotification\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:Q\xea\x41N\n\x18\x62\x61tch.googleapis.com/Job\x12\x32projects/{project}/locations/{location}/jobs/{job}\"\xcd\x02\n\nLogsPolicy\x12\x42\n\x0b\x64\x65stination\x18\x01 \x01(\x0e\x32-.google.cloud.batch.v1.LogsPolicy.Destination\x12\x11\n\tlogs_path\x18\x02 \x01(\t\x12W\n\x14\x63loud_logging_option\x18\x03 \x01(\x0b\x32\x34.google.cloud.batch.v1.LogsPolicy.CloudLoggingOptionB\x03\xe0\x41\x01\x1a\x46\n\x12\x43loudLoggingOption\x12\x30\n#use_generic_task_monitored_resource\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"G\n\x0b\x44\x65stination\x12\x1b\n\x17\x44\x45STINATION_UNSPECIFIED\x10\x00\x12\x11\n\rCLOUD_LOGGING\x10\x01\x12\x08\n\x04PATH\x10\x02\"\x80\x07\n\tJobStatus\x12\x35\n\x05state\x18\x01 \x01(\x0e\x32&.google.cloud.batch.v1.JobStatus.State\x12\x39\n\rstatus_events\x18\x02 \x03(\x0b\x32\".google.cloud.batch.v1.StatusEvent\x12\x45\n\x0btask_groups\x18\x04 \x03(\x0b\x32\x30.google.cloud.batch.v1.JobStatus.TaskGroupsEntry\x12/\n\x0crun_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\xd1\x01\n\x0eInstanceStatus\x12\x14\n\x0cmachine_type\x18\x01 \x01(\t\x12U\n\x12provisioning_model\x18\x02 \x01(\x0e\x32\x39.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel\x12\x11\n\ttask_pack\x18\x03 \x01(\x03\x12?\n\tboot_disk\x18\x04 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.Disk\x1a\xd2\x01\n\x0fTaskGroupStatus\x12L\n\x06\x63ounts\x18\x01 \x03(\x0b\x32<.google.cloud.batch.v1.JobStatus.TaskGroupStatus.CountsEntry\x12\x42\n\tinstances\x18\x02 \x03(\x0b\x32/.google.cloud.batch.v1.JobStatus.InstanceStatus\x1a-\n\x0b\x43ountsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x63\n\x0fTaskGroupsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.google.cloud.batch.v1.JobStatus.TaskGroupStatus:\x02\x38\x01\"{\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06QUEUED\x10\x01\x12\r\n\tSCHEDULED\x10\x02\x12\x0b\n\x07RUNNING\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05\x12\x18\n\x14\x44\x45LETION_IN_PROGRESS\x10\x06\"\xfc\x02\n\x0fJobNotification\x12\x14\n\x0cpubsub_topic\x18\x01 \x01(\t\x12?\n\x07message\x18\x02 \x01(\x0b\x32..google.cloud.batch.v1.JobNotification.Message\x1a\xc4\x01\n\x07Message\x12\x39\n\x04type\x18\x01 \x01(\x0e\x32+.google.cloud.batch.v1.JobNotification.Type\x12=\n\rnew_job_state\x18\x02 \x01(\x0e\x32&.google.cloud.batch.v1.JobStatus.State\x12?\n\x0enew_task_state\x18\x03 \x01(\x0e\x32\'.google.cloud.batch.v1.TaskStatus.State\"K\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11JOB_STATE_CHANGED\x10\x01\x12\x16\n\x12TASK_STATE_CHANGED\x10\x02\"\x81\x0f\n\x10\x41llocationPolicy\x12H\n\x08location\x18\x01 \x01(\x0b\x32\x36.google.cloud.batch.v1.AllocationPolicy.LocationPolicy\x12S\n\tinstances\x18\x08 \x03(\x0b\x32@.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate\x12>\n\x0fservice_account\x18\t \x01(\x0b\x32%.google.cloud.batch.v1.ServiceAccount\x12\x43\n\x06labels\x18\x06 \x03(\x0b\x32\x33.google.cloud.batch.v1.AllocationPolicy.LabelsEntry\x12\x46\n\x07network\x18\x07 \x01(\x0b\x32\x35.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy\x12J\n\tplacement\x18\n \x01(\x0b\x32\x37.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy\x12\x11\n\x04tags\x18\x0b \x03(\tB\x03\xe0\x41\x01\x1a+\n\x0eLocationPolicy\x12\x19\n\x11\x61llowed_locations\x18\x01 \x03(\t\x1aq\n\x04\x44isk\x12\x0f\n\x05image\x18\x04 \x01(\tH\x00\x12\x12\n\x08snapshot\x18\x05 \x01(\tH\x00\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07size_gb\x18\x02 \x01(\x03\x12\x16\n\x0e\x64isk_interface\x18\x06 \x01(\tB\r\n\x0b\x64\x61ta_source\x1a\x8a\x01\n\x0c\x41ttachedDisk\x12@\n\x08new_disk\x18\x01 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.DiskH\x00\x12\x17\n\rexisting_disk\x18\x02 \x01(\tH\x00\x12\x13\n\x0b\x64\x65vice_name\x18\x03 \x01(\tB\n\n\x08\x61ttached\x1ah\n\x0b\x41\x63\x63\x65lerator\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x03\x12\x1f\n\x13install_gpu_drivers\x18\x03 \x01(\x08\x42\x02\x18\x01\x12\x1b\n\x0e\x64river_version\x18\x04 \x01(\tB\x03\xe0\x41\x01\x1a\x82\x03\n\x0eInstancePolicy\x12\x14\n\x0cmachine_type\x18\x02 \x01(\t\x12\x18\n\x10min_cpu_platform\x18\x03 \x01(\t\x12U\n\x12provisioning_model\x18\x04 \x01(\x0e\x32\x39.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel\x12I\n\x0c\x61\x63\x63\x65lerators\x18\x05 \x03(\x0b\x32\x33.google.cloud.batch.v1.AllocationPolicy.Accelerator\x12?\n\tboot_disk\x18\x08 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.Disk\x12\x43\n\x05\x64isks\x18\x06 \x03(\x0b\x32\x34.google.cloud.batch.v1.AllocationPolicy.AttachedDisk\x12\x18\n\x0breservation\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\xf6\x01\n\x18InstancePolicyOrTemplate\x12H\n\x06policy\x18\x01 \x01(\x0b\x32\x36.google.cloud.batch.v1.AllocationPolicy.InstancePolicyH\x00\x12\x1b\n\x11instance_template\x18\x02 \x01(\tH\x00\x12\x1b\n\x13install_gpu_drivers\x18\x03 \x01(\x08\x12\x1e\n\x11install_ops_agent\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12#\n\x16\x62lock_project_ssh_keys\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x42\x11\n\x0fpolicy_template\x1aW\n\x10NetworkInterface\x12\x0f\n\x07network\x18\x01 \x01(\t\x12\x12\n\nsubnetwork\x18\x02 \x01(\t\x12\x1e\n\x16no_external_ip_address\x18\x03 \x01(\x08\x1a\x65\n\rNetworkPolicy\x12T\n\x12network_interfaces\x18\x01 \x03(\x0b\x32\x38.google.cloud.batch.v1.AllocationPolicy.NetworkInterface\x1a<\n\x0fPlacementPolicy\x12\x13\n\x0b\x63ollocation\x18\x01 \x01(\t\x12\x14\n\x0cmax_distance\x18\x02 \x01(\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"`\n\x11ProvisioningModel\x12\"\n\x1ePROVISIONING_MODEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x08\n\x04SPOT\x10\x02\x12\x0f\n\x0bPREEMPTIBLE\x10\x03\"\xcb\x04\n\tTaskGroup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x37\n\ttask_spec\x18\x03 \x01(\x0b\x32\x1f.google.cloud.batch.v1.TaskSpecB\x03\xe0\x41\x02\x12\x12\n\ntask_count\x18\x04 \x01(\x03\x12\x13\n\x0bparallelism\x18\x05 \x01(\x03\x12L\n\x11scheduling_policy\x18\x06 \x01(\x0e\x32\x31.google.cloud.batch.v1.TaskGroup.SchedulingPolicy\x12=\n\x11task_environments\x18\t \x03(\x0b\x32\".google.cloud.batch.v1.Environment\x12\x1b\n\x13task_count_per_node\x18\n \x01(\x03\x12\x1a\n\x12require_hosts_file\x18\x0b \x01(\x08\x12\x16\n\x0epermissive_ssh\x18\x0c \x01(\x08\x12\x1c\n\x0frun_as_non_root\x18\x0e \x01(\x08\x42\x03\xe0\x41\x01\"\\\n\x10SchedulingPolicy\x12!\n\x1dSCHEDULING_POLICY_UNSPECIFIED\x10\x00\x12\x17\n\x13\x41S_SOON_AS_POSSIBLE\x10\x01\x12\x0c\n\x08IN_ORDER\x10\x02:o\xea\x41l\n\x1e\x62\x61tch.googleapis.com/TaskGroup\x12Jprojects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}\"/\n\x0eServiceAccount\x12\r\n\x05\x65mail\x18\x01 \x01(\t\x12\x0e\n\x06scopes\x18\x02 \x03(\tB\xa9\x01\n\x19\x63om.google.cloud.batch.v1B\x08JobProtoP\x01Z/cloud.google.com/go/batch/apiv1/batchpb;batchpb\xa2\x02\x03GCB\xaa\x02\x15Google.Cloud.Batch.V1\xca\x02\x15Google\\Cloud\\Batch\\V1\xea\x02\x18Google::Cloud::Batch::V1b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool diff --git a/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/job.rb b/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/job.rb index 354cb6dbd1a1..a649c3103a87 100644 --- a/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/job.rb +++ b/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/job.rb @@ -532,6 +532,25 @@ class InstancePolicy # @return [::Boolean] # Optional. Set this field true if you want Batch to install Ops Agent on # your behalf. Default is false. + # @!attribute [rw] block_project_ssh_keys + # @return [::Boolean] + # Optional. Set this field to `true` if you want Batch to block + # project-level SSH keys from accessing this job's VMs. Alternatively, you + # can configure the job to specify a VM instance template that blocks + # project-level SSH keys. In either case, Batch blocks project-level SSH + # keys while creating the VMs for this job. + # + # Batch allows project-level SSH keys for a job's VMs only if all + # the following are true: + # + # + This field is undefined or set to `false`. + # + The job's VM instance template (if any) doesn't block project-level + # SSH keys. + # + # Notably, you can override this behavior by manually updating a VM to + # block or allow project-level SSH keys. For more information about + # blocking project-level SSH keys, see the Compute Engine documentation: + # https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys class InstancePolicyOrTemplate include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/owl-bot-staging/google-cloud-batch-v1/.gitignore b/owl-bot-staging/google-cloud-batch-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-cloud-batch-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-batch-v1/.repo-metadata.json deleted file mode 100644 index e36027edffb2..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/.repo-metadata.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "api_id": "batch.googleapis.com", - "api_shortname": "batch", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest", - "distribution_name": "google-cloud-batch-v1", - "is_cloud": true, - "language": "ruby", - "name": "batch", - "name_pretty": "Batch V1 API", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Google Cloud Batch is a fully managed service used by scientists, VFX artists, developers to easily and efficiently run batch workloads on Google Cloud. This service manages provisioning of resources to satisfy the requirements of the batch jobs for a variety of workloads including ML, HPC, VFX rendering, transcoding, genomics and others. Note that google-cloud-batch-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-batch instead. See the readme for more details.", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-batch-v1/.rubocop.yml b/owl-bot-staging/google-cloud-batch-v1/.rubocop.yml deleted file mode 100644 index dfe88aff925c..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-batch-v1.gemspec" - - "lib/**/*_pb.rb" - - "proto_docs/**/*" - - "test/**/*" - - "acceptance/**/*" - - "samples/acceptance/**/*" - - "Rakefile" - -Layout/LineLength: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Naming/AccessorMethodName: - Exclude: - - "snippets/**/*.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-batch-v1.rb" diff --git a/owl-bot-staging/google-cloud-batch-v1/.toys.rb b/owl-bot-staging/google-cloud-batch-v1/.toys.rb deleted file mode 100644 index 23434bdd5d5b..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-batch-v1/.yardopts b/owl-bot-staging/google-cloud-batch-v1/.yardopts deleted file mode 100644 index 5628edd53225..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Batch V1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-batch-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-batch-v1/AUTHENTICATION.md deleted file mode 100644 index 08e3de31e49e..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-batch-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-batch-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/batch/v1" - -client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/batch/v1" - -::Google::Cloud::Batch::V1::BatchService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Batch::V1::BatchService::Client.new -``` - -### Environment Variables - -You can also use an environment variable to provide a JSON credentials file. -The environment variable can contain a path to the credentials file or, for -environments such as Docker containers where writing files is not encouraged, -you can include the credentials file itself. - -The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -The environment variables that google-cloud-batch-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/batch/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Batch::V1::BatchService::Client.new -``` - -### Local ADC file - -You can set up a local ADC file with your user credentials for authentication during -development. If credentials are not provided in code or in environment variables, -then the local ADC credentials are discovered. - -Follow the steps in [Quickstart](#quickstart) to set up a local ADC file. - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine -(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud -Functions (GCF) and Cloud Run, credentials are retrieved from the attached -service account automatically. Code should be written as if already authenticated. - -For more information, see -[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa). diff --git a/owl-bot-staging/google-cloud-batch-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-batch-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-batch-v1/Gemfile b/owl-bot-staging/google-cloud-batch-v1/Gemfile deleted file mode 100644 index 95163a6d11f8..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.27.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-batch-v1/LICENSE.md b/owl-bot-staging/google-cloud-batch-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-batch-v1/README.md b/owl-bot-staging/google-cloud-batch-v1/README.md deleted file mode 100644 index 41d3f7a98da6..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# Ruby Client for the Batch V1 API - -An API to manage the running of Batch resources on Google Cloud Platform. - -Google Cloud Batch is a fully managed service used by scientists, VFX artists, developers to easily and efficiently run batch workloads on Google Cloud. This service manages provisioning of resources to satisfy the requirements of the batch jobs for a variety of workloads including ML, HPC, VFX rendering, transcoding, genomics and others. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Batch V1 API. Most users should consider using -the main client gem, -[google-cloud-batch](https://rubygems.org/gems/google-cloud-batch). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-batch-v1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/batch.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/batch/v1" - -client = ::Google::Cloud::Batch::V1::BatchService::Client.new -request = ::Google::Cloud::Batch::V1::CreateJobRequest.new # (request fields as keyword arguments...) -response = client.create_job request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest) -for class and method documentation. - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. -The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below, -or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest) -that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 2.7+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-batch`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-batch-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-batch`. -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-batch-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-batch-v1/Rakefile b/owl-bot-staging/google-cloud-batch-v1/Rakefile deleted file mode 100644 index bad6d91c4090..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -desc "Runs the smoke tests." -Rake::TestTask.new :smoke_test do |t| - t.test_files = FileList["acceptance/**/*smoke_test.rb"] - t.warning = false -end - -# Acceptance tests -desc "Run the google-cloud-batch-v1 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/batch/v1/batch_service/credentials" - ::Google::Cloud::Batch::V1::BatchService::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-batch-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-batch-v1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-batch-v1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-batch-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-batch-v1" - header "google-cloud-batch-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-batch-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-batch-v1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-batch-v1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-batch-v1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-batch-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-batch-v1/gapic_metadata.json deleted file mode 100644 index a4cb50eded13..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/gapic_metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.batch.v1", - "libraryPackage": "::Google::Cloud::Batch::V1", - "services": { - "BatchService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Batch::V1::BatchService::Client", - "rpcs": { - "CreateJob": { - "methods": [ - "create_job" - ] - }, - "GetJob": { - "methods": [ - "get_job" - ] - }, - "DeleteJob": { - "methods": [ - "delete_job" - ] - }, - "ListJobs": { - "methods": [ - "list_jobs" - ] - }, - "GetTask": { - "methods": [ - "get_task" - ] - }, - "ListTasks": { - "methods": [ - "list_tasks" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-batch-v1/google-cloud-batch-v1.gemspec b/owl-bot-staging/google-cloud-batch-v1/google-cloud-batch-v1.gemspec deleted file mode 100644 index f411e4de702e..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/google-cloud-batch-v1.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/batch/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-batch-v1" - gem.version = Google::Cloud::Batch::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Google Cloud Batch is a fully managed service used by scientists, VFX artists, developers to easily and efficiently run batch workloads on Google Cloud. This service manages provisioning of resources to satisfy the requirements of the batch jobs for a variety of workloads including ML, HPC, VFX rendering, transcoding, genomics and others. Note that google-cloud-batch-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-batch instead. See the readme for more details." - gem.summary = "An API to manage the running of Batch resources on Google Cloud Platform." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 2.7" - - gem.add_dependency "gapic-common", ">= 0.21.1", "< 2.a" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", ">= 0.7", "< 2.a" - gem.add_dependency "grpc-google-iam-v1", "~> 1.1" -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google-cloud-batch-v1.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google-cloud-batch-v1.rb deleted file mode 100644 index 5ba63ef2b1ba..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google-cloud-batch-v1.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/cloud/batch/v1" -# require "google/iam/v1" diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1.rb deleted file mode 100644 index 1d39572863b6..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/batch/v1/batch_service" -require "google/cloud/batch/v1/version" - -module Google - module Cloud - module Batch - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/batch/v1" - # client = ::Google::Cloud::Batch::V1::BatchService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/batch/v1" - # client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/batch/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_pb.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_pb.rb deleted file mode 100644 index d1621fb84219..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_pb.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/batch/v1/batch.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/field_info_pb' -require 'google/api/resource_pb' -require 'google/cloud/batch/v1/job_pb' -require 'google/cloud/batch/v1/task_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n!google/cloud/batch/v1/batch.proto\x12\x15google.cloud.batch.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/cloud/batch/v1/job.proto\x1a google/cloud/batch/v1/task.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9b\x01\n\x10\x43reateJobRequest\x12\x30\n\x06parent\x18\x01 \x01(\tB \xe0\x41\x02\xfa\x41\x1a\x12\x18\x62\x61tch.googleapis.com/Job\x12\x0e\n\x06job_id\x18\x02 \x01(\t\x12,\n\x03job\x18\x03 \x01(\x0b\x32\x1a.google.cloud.batch.v1.JobB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"?\n\rGetJobRequest\x12.\n\x04name\x18\x01 \x01(\tB \xe0\x41\x02\xfa\x41\x1a\n\x18\x62\x61tch.googleapis.com/Job\"N\n\x10\x44\x65leteJobRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x06reason\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"o\n\x0fListJobsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x15\n\x08order_by\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"j\n\x10ListJobsResponse\x12(\n\x04jobs\x18\x01 \x03(\x0b\x32\x1a.google.cloud.batch.v1.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x81\x01\n\x10ListTasksRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x62\x61tch.googleapis.com/TaskGroup\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x12\n\npage_token\x18\x04 \x01(\t\"m\n\x11ListTasksResponse\x12*\n\x05tasks\x18\x01 \x03(\x0b\x32\x1b.google.cloud.batch.v1.Task\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"A\n\x0eGetTaskRequest\x12/\n\x04name\x18\x01 \x01(\tB!\xe0\x41\x02\xfa\x41\x1b\n\x19\x62\x61tch.googleapis.com/Task\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x32\xb6\x08\n\x0c\x42\x61tchService\x12\x9b\x01\n\tCreateJob\x12\'.google.cloud.batch.v1.CreateJobRequest\x1a\x1a.google.cloud.batch.v1.Job\"I\xda\x41\x11parent,job,job_id\x82\xd3\xe4\x93\x02/\"(/v1/{parent=projects/*/locations/*}/jobs:\x03job\x12\x83\x01\n\x06GetJob\x12$.google.cloud.batch.v1.GetJobRequest\x1a\x1a.google.cloud.batch.v1.Job\"7\xda\x41\x04name\x82\xd3\xe4\x93\x02*\x12(/v1/{name=projects/*/locations/*/jobs/*}\x12\xcf\x01\n\tDeleteJob\x12\'.google.cloud.batch.v1.DeleteJobRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41@\n\x15google.protobuf.Empty\x12\'google.cloud.batch.v1.OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02**(/v1/{name=projects/*/locations/*/jobs/*}\x12\x96\x01\n\x08ListJobs\x12&.google.cloud.batch.v1.ListJobsRequest\x1a\'.google.cloud.batch.v1.ListJobsResponse\"9\xda\x41\x06parent\x82\xd3\xe4\x93\x02*\x12(/v1/{parent=projects/*/locations/*}/jobs\x12\x9b\x01\n\x07GetTask\x12%.google.cloud.batch.v1.GetTaskRequest\x1a\x1b.google.cloud.batch.v1.Task\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v1/{name=projects/*/locations/*/jobs/*/taskGroups/*/tasks/*}\x12\xae\x01\n\tListTasks\x12\'.google.cloud.batch.v1.ListTasksRequest\x1a(.google.cloud.batch.v1.ListTasksResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/locations/*/jobs/*/taskGroups/*}/tasks\x1aH\xca\x41\x14\x62\x61tch.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xab\x01\n\x19\x63om.google.cloud.batch.v1B\nBatchProtoP\x01Z/cloud.google.com/go/batch/apiv1/batchpb;batchpb\xa2\x02\x03GCB\xaa\x02\x15Google.Cloud.Batch.V1\xca\x02\x15Google\\Cloud\\Batch\\V1\xea\x02\x18Google::Cloud::Batch::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.cloud.batch.v1.Job", "google/cloud/batch/v1/job.proto"], - ["google.cloud.batch.v1.Task", "google/cloud/batch/v1/task.proto"], - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Batch - module V1 - CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.CreateJobRequest").msgclass - GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.GetJobRequest").msgclass - DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.DeleteJobRequest").msgclass - ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.ListJobsRequest").msgclass - ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.ListJobsResponse").msgclass - ListTasksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.ListTasksRequest").msgclass - ListTasksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.ListTasksResponse").msgclass - GetTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.GetTaskRequest").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.OperationMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service.rb deleted file mode 100644 index 0a5b1d2ce724..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/batch/v1/version" - -require "google/cloud/batch/v1/batch_service/credentials" -require "google/cloud/batch/v1/batch_service/paths" -require "google/cloud/batch/v1/batch_service/operations" -require "google/cloud/batch/v1/batch_service/client" -require "google/cloud/batch/v1/batch_service/rest" - -module Google - module Cloud - module Batch - module V1 - ## - # Google Batch Service. - # The service manages user submitted batch jobs and allocates Google Compute - # Engine VM instances to run the jobs. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/batch/v1/batch_service" - # client = ::Google::Cloud::Batch::V1::BatchService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/batch/v1/batch_service/rest" - # client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new - # - module BatchService - end - end - end - end -end - -helper_path = ::File.join __dir__, "batch_service", "helpers.rb" -require "google/cloud/batch/v1/batch_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/client.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/client.rb deleted file mode 100644 index a5c2ebac0ab1..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/client.rb +++ /dev/null @@ -1,1025 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/batch/v1/batch_pb" -require "google/cloud/location" - -module Google - module Cloud - module Batch - module V1 - module BatchService - ## - # Client for the BatchService service. - # - # Google Batch Service. - # The service manages user submitted batch jobs and allocates Google Compute - # Engine VM instances to run the jobs. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "batch.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :batch_service_stub - - ## - # Configure the BatchService Client class. - # - # See {::Google::Cloud::Batch::V1::BatchService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all BatchService clients - # ::Google::Cloud::Batch::V1::BatchService::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Batch", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_job.timeout = 60.0 - - default_config.rpcs.get_job.timeout = 60.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_job.timeout = 60.0 - - default_config.rpcs.list_jobs.timeout = 60.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_task.timeout = 60.0 - default_config.rpcs.get_task.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_tasks.timeout = 60.0 - default_config.rpcs.list_tasks.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the BatchService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Batch::V1::BatchService::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @batch_service_stub.universe_domain - end - - ## - # Create a new BatchService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Batch::V1::BatchService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the BatchService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/batch/v1/batch_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @batch_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Batch::V1::BatchService::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @batch_service_stub.endpoint - config.universe_domain = @batch_service_stub.universe_domain - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Batch::V1::BatchService::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - # Service calls - - ## - # Create a Job. - # - # @overload create_job(request, options = nil) - # Pass arguments to `create_job` via a request object, either of type - # {::Google::Cloud::Batch::V1::CreateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Batch::V1::CreateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload create_job(parent: nil, job_id: nil, job: nil, request_id: nil) - # Pass arguments to `create_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name where the Job will be created. - # Pattern: "projects/\\{project}/locations/\\{location}" - # @param job_id [::String] - # ID used to uniquely identify the Job within its parent scope. - # This field should contain at most 63 characters and must start with - # lowercase characters. - # Only lowercase characters, numbers and '-' are accepted. - # The '-' character cannot be the first or the last one. - # A system generated ID will be used if the field is not set. - # - # The job.name field in the request will be ignored and the created resource - # name of the Job will be "\\{parent}/jobs/\\{job_id}". - # @param job [::Google::Cloud::Batch::V1::Job, ::Hash] - # Required. The Job to create. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Batch::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Batch::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/batch/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Batch::V1::BatchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Batch::V1::CreateJobRequest.new - # - # # Call the create_job method. - # result = client.create_job request - # - # # The returned object is of type Google::Cloud::Batch::V1::Job. - # p result - # - def create_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::CreateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.create_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_service_stub.call_rpc :create_job, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get a Job specified by its resource name. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::Batch::V1::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Batch::V1::GetJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_job(name: nil) - # Pass arguments to `get_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Job name. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Batch::V1::Job] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Batch::V1::Job] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/batch/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Batch::V1::BatchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Batch::V1::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::Batch::V1::Job. - # p result - # - def get_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::GetJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_service_stub.call_rpc :get_job, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Delete a Job. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::Batch::V1::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Batch::V1::DeleteJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_job(name: nil, reason: nil, request_id: nil) - # Pass arguments to `delete_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Job name. - # @param reason [::String] - # Optional. Reason for this deletion. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/batch/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Batch::V1::BatchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Batch::V1::DeleteJobRequest.new - # - # # Call the delete_job method. - # result = client.delete_job request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::DeleteJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_service_stub.call_rpc :delete_job, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List all Jobs for a project within a region. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::Batch::V1::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Batch::V1::ListJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_jobs(parent: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Parent path. - # @param filter [::String] - # List filter. - # @param order_by [::String] - # Optional. Sort results. Supported are "name", "name desc", "create_time", - # and "create_time desc". - # @param page_size [::Integer] - # Page size. - # @param page_token [::String] - # Page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Batch::V1::Job>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Batch::V1::Job>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/batch/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Batch::V1::BatchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Batch::V1::ListJobsRequest.new - # - # # Call the list_jobs method. - # result = client.list_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Batch::V1::Job. - # p item - # end - # - def list_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::ListJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_service_stub.call_rpc :list_jobs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @batch_service_stub, :list_jobs, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Return a single Task. - # - # @overload get_task(request, options = nil) - # Pass arguments to `get_task` via a request object, either of type - # {::Google::Cloud::Batch::V1::GetTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Batch::V1::GetTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_task(name: nil) - # Pass arguments to `get_task` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Task name. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Batch::V1::Task] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Batch::V1::Task] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/batch/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Batch::V1::BatchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Batch::V1::GetTaskRequest.new - # - # # Call the get_task method. - # result = client.get_task request - # - # # The returned object is of type Google::Cloud::Batch::V1::Task. - # p result - # - def get_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::GetTaskRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_task.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_task.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_service_stub.call_rpc :get_task, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List Tasks associated with a job. - # - # @overload list_tasks(request, options = nil) - # Pass arguments to `list_tasks` via a request object, either of type - # {::Google::Cloud::Batch::V1::ListTasksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Batch::V1::ListTasksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_tasks(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_tasks` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of a TaskGroup from which Tasks are being requested. - # Pattern: - # "projects/\\{project}/locations/\\{location}/jobs/\\{job}/taskGroups/\\{task_group}" - # @param filter [::String] - # Task filter, null filter matches all Tasks. - # Filter string should be of the format State=TaskStatus.State e.g. - # State=RUNNING - # @param page_size [::Integer] - # Page size. - # @param page_token [::String] - # Page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Batch::V1::Task>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Batch::V1::Task>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/batch/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Batch::V1::BatchService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Batch::V1::ListTasksRequest.new - # - # # Call the list_tasks method. - # result = client.list_tasks request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Batch::V1::Task. - # p item - # end - # - def list_tasks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::ListTasksRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_tasks.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_tasks.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_tasks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_service_stub.call_rpc :list_tasks, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @batch_service_stub, :list_tasks, request, response, operation, options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the BatchService API. - # - # This class represents the configuration for BatchService, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Batch::V1::BatchService::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_job to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Batch::V1::BatchService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_job.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_job.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "batch.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the BatchService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_job - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - ## - # RPC-specific configuration for `list_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `get_task` - # @return [::Gapic::Config::Method] - # - attr_reader :get_task - ## - # RPC-specific configuration for `list_tasks` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tasks - - # @private - def initialize parent_rpcs = nil - create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job - @create_job = ::Gapic::Config::Method.new create_job_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task - @get_task = ::Gapic::Config::Method.new get_task_config - list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks - @list_tasks = ::Gapic::Config::Method.new list_tasks_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/credentials.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/credentials.rb deleted file mode 100644 index 0b8add596020..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/credentials.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Batch - module V1 - module BatchService - # Credentials for the BatchService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/operations.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/operations.rb deleted file mode 100644 index 2a79186dff2e..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/operations.rb +++ /dev/null @@ -1,809 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Batch - module V1 - module BatchService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "batch.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the BatchService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the BatchService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "batch.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/paths.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/paths.rb deleted file mode 100644 index e614ad8cad43..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/paths.rb +++ /dev/null @@ -1,113 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Batch - module V1 - module BatchService - # Path helper methods for the BatchService API. - module Paths - ## - # Create a fully-qualified Job resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/jobs/{job}` - # - # @param project [String] - # @param location [String] - # @param job [String] - # - # @return [::String] - def job_path project:, location:, job: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/jobs/#{job}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Task resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}` - # - # @param project [String] - # @param location [String] - # @param job [String] - # @param task_group [String] - # @param task [String] - # - # @return [::String] - def task_path project:, location:, job:, task_group:, task: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "job cannot contain /" if job.to_s.include? "/" - raise ::ArgumentError, "task_group cannot contain /" if task_group.to_s.include? "/" - - "projects/#{project}/locations/#{location}/jobs/#{job}/taskGroups/#{task_group}/tasks/#{task}" - end - - ## - # Create a fully-qualified TaskGroup resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}` - # - # @param project [String] - # @param location [String] - # @param job [String] - # @param task_group [String] - # - # @return [::String] - def task_group_path project:, location:, job:, task_group: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "job cannot contain /" if job.to_s.include? "/" - - "projects/#{project}/locations/#{location}/jobs/#{job}/taskGroups/#{task_group}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest.rb deleted file mode 100644 index 90f47cda85b2..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/batch/v1/version" -require "google/cloud/batch/v1/bindings_override" - -require "google/cloud/batch/v1/batch_service/credentials" -require "google/cloud/batch/v1/batch_service/paths" -require "google/cloud/batch/v1/batch_service/rest/operations" -require "google/cloud/batch/v1/batch_service/rest/client" - -module Google - module Cloud - module Batch - module V1 - ## - # Google Batch Service. - # The service manages user submitted batch jobs and allocates Google Compute - # Engine VM instances to run the jobs. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/batch/v1/batch_service/rest" - # client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new - # - module BatchService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/batch/v1/batch_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/client.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/client.rb deleted file mode 100644 index e034de34410b..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/client.rb +++ /dev/null @@ -1,963 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/cloud/batch/v1/batch_pb" -require "google/cloud/batch/v1/batch_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Batch - module V1 - module BatchService - module Rest - ## - # REST client for the BatchService service. - # - # Google Batch Service. - # The service manages user submitted batch jobs and allocates Google Compute - # Engine VM instances to run the jobs. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "batch.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :batch_service_stub - - ## - # Configure the BatchService Client class. - # - # See {::Google::Cloud::Batch::V1::BatchService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all BatchService clients - # ::Google::Cloud::Batch::V1::BatchService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Batch", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_job.timeout = 60.0 - - default_config.rpcs.get_job.timeout = 60.0 - default_config.rpcs.get_job.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_job.timeout = 60.0 - - default_config.rpcs.list_jobs.timeout = 60.0 - default_config.rpcs.list_jobs.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_task.timeout = 60.0 - default_config.rpcs.get_task.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_tasks.timeout = 60.0 - default_config.rpcs.list_tasks.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the BatchService Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Cloud::Batch::V1::BatchService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @batch_service_stub.universe_domain - end - - ## - # Create a new BatchService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the BatchService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Cloud::Batch::V1::BatchService::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @batch_service_stub = ::Google::Cloud::Batch::V1::BatchService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @batch_service_stub.endpoint - config.universe_domain = @batch_service_stub.universe_domain - config.bindings_override = @config.bindings_override - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Batch::V1::BatchService::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - # Service calls - - ## - # Create a Job. - # - # @overload create_job(request, options = nil) - # Pass arguments to `create_job` via a request object, either of type - # {::Google::Cloud::Batch::V1::CreateJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Batch::V1::CreateJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload create_job(parent: nil, job_id: nil, job: nil, request_id: nil) - # Pass arguments to `create_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource name where the Job will be created. - # Pattern: "projects/\\{project}/locations/\\{location}" - # @param job_id [::String] - # ID used to uniquely identify the Job within its parent scope. - # This field should contain at most 63 characters and must start with - # lowercase characters. - # Only lowercase characters, numbers and '-' are accepted. - # The '-' character cannot be the first or the last one. - # A system generated ID will be used if the field is not set. - # - # The job.name field in the request will be ignored and the created resource - # name of the Job will be "\\{parent}/jobs/\\{job_id}". - # @param job [::Google::Cloud::Batch::V1::Job, ::Hash] - # Required. The Job to create. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Batch::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Batch::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/batch/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Batch::V1::CreateJobRequest.new - # - # # Call the create_job method. - # result = client.create_job request - # - # # The returned object is of type Google::Cloud::Batch::V1::Job. - # p result - # - def create_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::CreateJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_service_stub.create_job request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Get a Job specified by its resource name. - # - # @overload get_job(request, options = nil) - # Pass arguments to `get_job` via a request object, either of type - # {::Google::Cloud::Batch::V1::GetJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Batch::V1::GetJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_job(name: nil) - # Pass arguments to `get_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Job name. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Batch::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Batch::V1::Job] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/batch/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Batch::V1::GetJobRequest.new - # - # # Call the get_job method. - # result = client.get_job request - # - # # The returned object is of type Google::Cloud::Batch::V1::Job. - # p result - # - def get_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::GetJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_service_stub.get_job request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Delete a Job. - # - # @overload delete_job(request, options = nil) - # Pass arguments to `delete_job` via a request object, either of type - # {::Google::Cloud::Batch::V1::DeleteJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Batch::V1::DeleteJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_job(name: nil, reason: nil, request_id: nil) - # Pass arguments to `delete_job` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Job name. - # @param reason [::String] - # Optional. Reason for this deletion. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/batch/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Batch::V1::DeleteJobRequest.new - # - # # Call the delete_job method. - # result = client.delete_job request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::DeleteJobRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_job.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_service_stub.delete_job request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List all Jobs for a project within a region. - # - # @overload list_jobs(request, options = nil) - # Pass arguments to `list_jobs` via a request object, either of type - # {::Google::Cloud::Batch::V1::ListJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Batch::V1::ListJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_jobs(parent: nil, filter: nil, order_by: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_jobs` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Parent path. - # @param filter [::String] - # List filter. - # @param order_by [::String] - # Optional. Sort results. Supported are "name", "name desc", "create_time", - # and "create_time desc". - # @param page_size [::Integer] - # Page size. - # @param page_token [::String] - # Page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Batch::V1::ListJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Batch::V1::ListJobsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/batch/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Batch::V1::ListJobsRequest.new - # - # # Call the list_jobs method. - # result = client.list_jobs request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Batch::V1::Job. - # p item - # end - # - def list_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::ListJobsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_jobs.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_service_stub.list_jobs request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Return a single Task. - # - # @overload get_task(request, options = nil) - # Pass arguments to `get_task` via a request object, either of type - # {::Google::Cloud::Batch::V1::GetTaskRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Batch::V1::GetTaskRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_task(name: nil) - # Pass arguments to `get_task` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Task name. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Batch::V1::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Batch::V1::Task] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/batch/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Batch::V1::GetTaskRequest.new - # - # # Call the get_task method. - # result = client.get_task request - # - # # The returned object is of type Google::Cloud::Batch::V1::Task. - # p result - # - def get_task request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::GetTaskRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_task.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_task.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_task.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_service_stub.get_task request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # List Tasks associated with a job. - # - # @overload list_tasks(request, options = nil) - # Pass arguments to `list_tasks` via a request object, either of type - # {::Google::Cloud::Batch::V1::ListTasksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Batch::V1::ListTasksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_tasks(parent: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_tasks` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. Name of a TaskGroup from which Tasks are being requested. - # Pattern: - # "projects/\\{project}/locations/\\{location}/jobs/\\{job}/taskGroups/\\{task_group}" - # @param filter [::String] - # Task filter, null filter matches all Tasks. - # Filter string should be of the format State=TaskStatus.State e.g. - # State=RUNNING - # @param page_size [::Integer] - # Page size. - # @param page_token [::String] - # Page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Batch::V1::ListTasksResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Batch::V1::ListTasksResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/batch/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Batch::V1::BatchService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Batch::V1::ListTasksRequest.new - # - # # Call the list_tasks method. - # result = client.list_tasks request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Cloud::Batch::V1::Task. - # p item - # end - # - def list_tasks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Batch::V1::ListTasksRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_tasks.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_tasks.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_tasks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @batch_service_stub.list_tasks request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the BatchService REST API. - # - # This class represents the configuration for BatchService REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Cloud::Batch::V1::BatchService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_job to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Batch::V1::BatchService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_job.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_job.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "batch.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the BatchService API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_job - ## - # RPC-specific configuration for `get_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_job - ## - # RPC-specific configuration for `delete_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_job - ## - # RPC-specific configuration for `list_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_jobs - ## - # RPC-specific configuration for `get_task` - # @return [::Gapic::Config::Method] - # - attr_reader :get_task - ## - # RPC-specific configuration for `list_tasks` - # @return [::Gapic::Config::Method] - # - attr_reader :list_tasks - - # @private - def initialize parent_rpcs = nil - create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job - @create_job = ::Gapic::Config::Method.new create_job_config - get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job - @get_job = ::Gapic::Config::Method.new get_job_config - delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job - @delete_job = ::Gapic::Config::Method.new delete_job_config - list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs - @list_jobs = ::Gapic::Config::Method.new list_jobs_config - get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task - @get_task = ::Gapic::Config::Method.new get_task_config - list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks - @list_tasks = ::Gapic::Config::Method.new list_tasks_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/operations.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/operations.rb deleted file mode 100644 index 8a8162342516..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/operations.rb +++ /dev/null @@ -1,902 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Cloud - module Batch - module V1 - module BatchService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "batch.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the BatchService Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the BatchService Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # NOTE: the `name` binding allows API services to override the binding - # to use different resource name schemes, such as `users/*/operations`. To - # override the binding, API services can add a binding such as - # `"/v1/{name=users/*}/operations"` to their service configuration. - # For backwards compatibility, the default name includes the operations - # collection id, however overriding users must ensure the name binding - # is the parent resource, without the operations collection id. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, - # corresponding to `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "batch.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/service_stub.rb deleted file mode 100644 index 1f1ddd8e63bc..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_service/rest/service_stub.rb +++ /dev/null @@ -1,424 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/batch/v1/batch_pb" - -module Google - module Cloud - module Batch - module V1 - module BatchService - module Rest - ## - # REST service stub for the BatchService service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # Baseline implementation for the create_job REST call - # - # @param request_pb [::Google::Cloud::Batch::V1::CreateJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Batch::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Batch::V1::Job] - # A result object deserialized from the server's reply - def create_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Batch::V1::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_job REST call - # - # @param request_pb [::Google::Cloud::Batch::V1::GetJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Batch::V1::Job] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Batch::V1::Job] - # A result object deserialized from the server's reply - def get_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Batch::V1::Job.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the delete_job REST call - # - # @param request_pb [::Google::Cloud::Batch::V1::DeleteJobRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_job_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_jobs REST call - # - # @param request_pb [::Google::Cloud::Batch::V1::ListJobsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Batch::V1::ListJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Batch::V1::ListJobsResponse] - # A result object deserialized from the server's reply - def list_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_jobs_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Batch::V1::ListJobsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_task REST call - # - # @param request_pb [::Google::Cloud::Batch::V1::GetTaskRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Batch::V1::Task] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Batch::V1::Task] - # A result object deserialized from the server's reply - def get_task request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_task_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Batch::V1::Task.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the list_tasks REST call - # - # @param request_pb [::Google::Cloud::Batch::V1::ListTasksRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Batch::V1::ListTasksResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Batch::V1::ListTasksResponse] - # A result object deserialized from the server's reply - def list_tasks request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_tasks_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Batch::V1::ListTasksResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the create_job REST call - # - # @param request_pb [::Google::Cloud::Batch::V1::CreateJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/jobs", - body: "job", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_job REST call - # - # @param request_pb [::Google::Cloud::Batch::V1::GetJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_job REST call - # - # @param request_pb [::Google::Cloud::Batch::V1::DeleteJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_jobs REST call - # - # @param request_pb [::Google::Cloud::Batch::V1::ListJobsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/jobs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_task REST call - # - # @param request_pb [::Google::Cloud::Batch::V1::GetTaskRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_task_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/taskGroups/[^/]+/tasks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_tasks REST call - # - # @param request_pb [::Google::Cloud::Batch::V1::ListTasksRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_tasks_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/tasks", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/jobs/[^/]+/taskGroups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_services_pb.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_services_pb.rb deleted file mode 100644 index 917796b2dc99..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/batch_services_pb.rb +++ /dev/null @@ -1,57 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/batch/v1/batch.proto for package 'Google.Cloud.Batch.V1' -# Original file comments: -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/cloud/batch/v1/batch_pb' - -module Google - module Cloud - module Batch - module V1 - module BatchService - # Google Batch Service. - # The service manages user submitted batch jobs and allocates Google Compute - # Engine VM instances to run the jobs. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.batch.v1.BatchService' - - # Create a Job. - rpc :CreateJob, ::Google::Cloud::Batch::V1::CreateJobRequest, ::Google::Cloud::Batch::V1::Job - # Get a Job specified by its resource name. - rpc :GetJob, ::Google::Cloud::Batch::V1::GetJobRequest, ::Google::Cloud::Batch::V1::Job - # Delete a Job. - rpc :DeleteJob, ::Google::Cloud::Batch::V1::DeleteJobRequest, ::Google::Longrunning::Operation - # List all Jobs for a project within a region. - rpc :ListJobs, ::Google::Cloud::Batch::V1::ListJobsRequest, ::Google::Cloud::Batch::V1::ListJobsResponse - # Return a single Task. - rpc :GetTask, ::Google::Cloud::Batch::V1::GetTaskRequest, ::Google::Cloud::Batch::V1::Task - # List Tasks associated with a job. - rpc :ListTasks, ::Google::Cloud::Batch::V1::ListTasksRequest, ::Google::Cloud::Batch::V1::ListTasksResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/bindings_override.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/bindings_override.rb deleted file mode 100644 index 962245c1b9f9..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/bindings_override.rb +++ /dev/null @@ -1,102 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/config" - -module Google - module Cloud - module Batch - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/batch/v1/rest" - # client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Batch"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = Configuration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - - ## - # @private - # Configuration class for the google.cloud.batch.v1 package. - # - # This class contains common configuration for all services - # of the google.cloud.batch.v1 package. - # - # This configuration is for internal use of the client library classes, - # and it is not intended that the end-users will read or change it. - # - class Configuration - extend ::Gapic::Config - - # @private - # Overrides for http bindings for the RPC of the mixins for this package. - # Services in this package should use these when creating clients for the mixin services. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/job_pb.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/job_pb.rb deleted file mode 100644 index c9cc28e4b26b..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/job_pb.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/batch/v1/job.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/batch/v1/task_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n\x1fgoogle/cloud/batch/v1/job.proto\x12\x15google.cloud.batch.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a google/cloud/batch/v1/task.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x90\x05\n\x03Job\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x08priority\x18\x03 \x01(\x03\x12:\n\x0btask_groups\x18\x04 \x03(\x0b\x32 .google.cloud.batch.v1.TaskGroupB\x03\xe0\x41\x02\x12\x42\n\x11\x61llocation_policy\x18\x07 \x01(\x0b\x32\'.google.cloud.batch.v1.AllocationPolicy\x12\x36\n\x06labels\x18\x08 \x03(\x0b\x32&.google.cloud.batch.v1.Job.LabelsEntry\x12\x35\n\x06status\x18\t \x01(\x0b\x32 .google.cloud.batch.v1.JobStatusB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x0b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x36\n\x0blogs_policy\x18\r \x01(\x0b\x32!.google.cloud.batch.v1.LogsPolicy\x12=\n\rnotifications\x18\x0e \x03(\x0b\x32&.google.cloud.batch.v1.JobNotification\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:Q\xea\x41N\n\x18\x62\x61tch.googleapis.com/Job\x12\x32projects/{project}/locations/{location}/jobs/{job}\"\xcd\x02\n\nLogsPolicy\x12\x42\n\x0b\x64\x65stination\x18\x01 \x01(\x0e\x32-.google.cloud.batch.v1.LogsPolicy.Destination\x12\x11\n\tlogs_path\x18\x02 \x01(\t\x12W\n\x14\x63loud_logging_option\x18\x03 \x01(\x0b\x32\x34.google.cloud.batch.v1.LogsPolicy.CloudLoggingOptionB\x03\xe0\x41\x01\x1a\x46\n\x12\x43loudLoggingOption\x12\x30\n#use_generic_task_monitored_resource\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\"G\n\x0b\x44\x65stination\x12\x1b\n\x17\x44\x45STINATION_UNSPECIFIED\x10\x00\x12\x11\n\rCLOUD_LOGGING\x10\x01\x12\x08\n\x04PATH\x10\x02\"\x80\x07\n\tJobStatus\x12\x35\n\x05state\x18\x01 \x01(\x0e\x32&.google.cloud.batch.v1.JobStatus.State\x12\x39\n\rstatus_events\x18\x02 \x03(\x0b\x32\".google.cloud.batch.v1.StatusEvent\x12\x45\n\x0btask_groups\x18\x04 \x03(\x0b\x32\x30.google.cloud.batch.v1.JobStatus.TaskGroupsEntry\x12/\n\x0crun_duration\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\xd1\x01\n\x0eInstanceStatus\x12\x14\n\x0cmachine_type\x18\x01 \x01(\t\x12U\n\x12provisioning_model\x18\x02 \x01(\x0e\x32\x39.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel\x12\x11\n\ttask_pack\x18\x03 \x01(\x03\x12?\n\tboot_disk\x18\x04 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.Disk\x1a\xd2\x01\n\x0fTaskGroupStatus\x12L\n\x06\x63ounts\x18\x01 \x03(\x0b\x32<.google.cloud.batch.v1.JobStatus.TaskGroupStatus.CountsEntry\x12\x42\n\tinstances\x18\x02 \x03(\x0b\x32/.google.cloud.batch.v1.JobStatus.InstanceStatus\x1a-\n\x0b\x43ountsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x63\n\x0fTaskGroupsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12?\n\x05value\x18\x02 \x01(\x0b\x32\x30.google.cloud.batch.v1.JobStatus.TaskGroupStatus:\x02\x38\x01\"{\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06QUEUED\x10\x01\x12\r\n\tSCHEDULED\x10\x02\x12\x0b\n\x07RUNNING\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05\x12\x18\n\x14\x44\x45LETION_IN_PROGRESS\x10\x06\"\xfc\x02\n\x0fJobNotification\x12\x14\n\x0cpubsub_topic\x18\x01 \x01(\t\x12?\n\x07message\x18\x02 \x01(\x0b\x32..google.cloud.batch.v1.JobNotification.Message\x1a\xc4\x01\n\x07Message\x12\x39\n\x04type\x18\x01 \x01(\x0e\x32+.google.cloud.batch.v1.JobNotification.Type\x12=\n\rnew_job_state\x18\x02 \x01(\x0e\x32&.google.cloud.batch.v1.JobStatus.State\x12?\n\x0enew_task_state\x18\x03 \x01(\x0e\x32\'.google.cloud.batch.v1.TaskStatus.State\"K\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11JOB_STATE_CHANGED\x10\x01\x12\x16\n\x12TASK_STATE_CHANGED\x10\x02\"\x81\x0f\n\x10\x41llocationPolicy\x12H\n\x08location\x18\x01 \x01(\x0b\x32\x36.google.cloud.batch.v1.AllocationPolicy.LocationPolicy\x12S\n\tinstances\x18\x08 \x03(\x0b\x32@.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate\x12>\n\x0fservice_account\x18\t \x01(\x0b\x32%.google.cloud.batch.v1.ServiceAccount\x12\x43\n\x06labels\x18\x06 \x03(\x0b\x32\x33.google.cloud.batch.v1.AllocationPolicy.LabelsEntry\x12\x46\n\x07network\x18\x07 \x01(\x0b\x32\x35.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy\x12J\n\tplacement\x18\n \x01(\x0b\x32\x37.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy\x12\x11\n\x04tags\x18\x0b \x03(\tB\x03\xe0\x41\x01\x1a+\n\x0eLocationPolicy\x12\x19\n\x11\x61llowed_locations\x18\x01 \x03(\t\x1aq\n\x04\x44isk\x12\x0f\n\x05image\x18\x04 \x01(\tH\x00\x12\x12\n\x08snapshot\x18\x05 \x01(\tH\x00\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07size_gb\x18\x02 \x01(\x03\x12\x16\n\x0e\x64isk_interface\x18\x06 \x01(\tB\r\n\x0b\x64\x61ta_source\x1a\x8a\x01\n\x0c\x41ttachedDisk\x12@\n\x08new_disk\x18\x01 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.DiskH\x00\x12\x17\n\rexisting_disk\x18\x02 \x01(\tH\x00\x12\x13\n\x0b\x64\x65vice_name\x18\x03 \x01(\tB\n\n\x08\x61ttached\x1ah\n\x0b\x41\x63\x63\x65lerator\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\r\n\x05\x63ount\x18\x02 \x01(\x03\x12\x1f\n\x13install_gpu_drivers\x18\x03 \x01(\x08\x42\x02\x18\x01\x12\x1b\n\x0e\x64river_version\x18\x04 \x01(\tB\x03\xe0\x41\x01\x1a\x82\x03\n\x0eInstancePolicy\x12\x14\n\x0cmachine_type\x18\x02 \x01(\t\x12\x18\n\x10min_cpu_platform\x18\x03 \x01(\t\x12U\n\x12provisioning_model\x18\x04 \x01(\x0e\x32\x39.google.cloud.batch.v1.AllocationPolicy.ProvisioningModel\x12I\n\x0c\x61\x63\x63\x65lerators\x18\x05 \x03(\x0b\x32\x33.google.cloud.batch.v1.AllocationPolicy.Accelerator\x12?\n\tboot_disk\x18\x08 \x01(\x0b\x32,.google.cloud.batch.v1.AllocationPolicy.Disk\x12\x43\n\x05\x64isks\x18\x06 \x03(\x0b\x32\x34.google.cloud.batch.v1.AllocationPolicy.AttachedDisk\x12\x18\n\x0breservation\x18\x07 \x01(\tB\x03\xe0\x41\x01\x1a\xf6\x01\n\x18InstancePolicyOrTemplate\x12H\n\x06policy\x18\x01 \x01(\x0b\x32\x36.google.cloud.batch.v1.AllocationPolicy.InstancePolicyH\x00\x12\x1b\n\x11instance_template\x18\x02 \x01(\tH\x00\x12\x1b\n\x13install_gpu_drivers\x18\x03 \x01(\x08\x12\x1e\n\x11install_ops_agent\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12#\n\x16\x62lock_project_ssh_keys\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x42\x11\n\x0fpolicy_template\x1aW\n\x10NetworkInterface\x12\x0f\n\x07network\x18\x01 \x01(\t\x12\x12\n\nsubnetwork\x18\x02 \x01(\t\x12\x1e\n\x16no_external_ip_address\x18\x03 \x01(\x08\x1a\x65\n\rNetworkPolicy\x12T\n\x12network_interfaces\x18\x01 \x03(\x0b\x32\x38.google.cloud.batch.v1.AllocationPolicy.NetworkInterface\x1a<\n\x0fPlacementPolicy\x12\x13\n\x0b\x63ollocation\x18\x01 \x01(\t\x12\x14\n\x0cmax_distance\x18\x02 \x01(\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"`\n\x11ProvisioningModel\x12\"\n\x1ePROVISIONING_MODEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x08\n\x04SPOT\x10\x02\x12\x0f\n\x0bPREEMPTIBLE\x10\x03\"\xcb\x04\n\tTaskGroup\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x37\n\ttask_spec\x18\x03 \x01(\x0b\x32\x1f.google.cloud.batch.v1.TaskSpecB\x03\xe0\x41\x02\x12\x12\n\ntask_count\x18\x04 \x01(\x03\x12\x13\n\x0bparallelism\x18\x05 \x01(\x03\x12L\n\x11scheduling_policy\x18\x06 \x01(\x0e\x32\x31.google.cloud.batch.v1.TaskGroup.SchedulingPolicy\x12=\n\x11task_environments\x18\t \x03(\x0b\x32\".google.cloud.batch.v1.Environment\x12\x1b\n\x13task_count_per_node\x18\n \x01(\x03\x12\x1a\n\x12require_hosts_file\x18\x0b \x01(\x08\x12\x16\n\x0epermissive_ssh\x18\x0c \x01(\x08\x12\x1c\n\x0frun_as_non_root\x18\x0e \x01(\x08\x42\x03\xe0\x41\x01\"\\\n\x10SchedulingPolicy\x12!\n\x1dSCHEDULING_POLICY_UNSPECIFIED\x10\x00\x12\x17\n\x13\x41S_SOON_AS_POSSIBLE\x10\x01\x12\x0c\n\x08IN_ORDER\x10\x02:o\xea\x41l\n\x1e\x62\x61tch.googleapis.com/TaskGroup\x12Jprojects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}\"/\n\x0eServiceAccount\x12\r\n\x05\x65mail\x18\x01 \x01(\t\x12\x0e\n\x06scopes\x18\x02 \x03(\tB\xa9\x01\n\x19\x63om.google.cloud.batch.v1B\x08JobProtoP\x01Z/cloud.google.com/go/batch/apiv1/batchpb;batchpb\xa2\x02\x03GCB\xaa\x02\x15Google.Cloud.Batch.V1\xca\x02\x15Google\\Cloud\\Batch\\V1\xea\x02\x18Google::Cloud::Batch::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.cloud.batch.v1.StatusEvent", "google/cloud/batch/v1/task.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Batch - module V1 - Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Job").msgclass - LogsPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.LogsPolicy").msgclass - LogsPolicy::CloudLoggingOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.LogsPolicy.CloudLoggingOption").msgclass - LogsPolicy::Destination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.LogsPolicy.Destination").enummodule - JobStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.JobStatus").msgclass - JobStatus::InstanceStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.JobStatus.InstanceStatus").msgclass - JobStatus::TaskGroupStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.JobStatus.TaskGroupStatus").msgclass - JobStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.JobStatus.State").enummodule - JobNotification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.JobNotification").msgclass - JobNotification::Message = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.JobNotification.Message").msgclass - JobNotification::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.JobNotification.Type").enummodule - AllocationPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy").msgclass - AllocationPolicy::LocationPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.LocationPolicy").msgclass - AllocationPolicy::Disk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.Disk").msgclass - AllocationPolicy::AttachedDisk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.AttachedDisk").msgclass - AllocationPolicy::Accelerator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.Accelerator").msgclass - AllocationPolicy::InstancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.InstancePolicy").msgclass - AllocationPolicy::InstancePolicyOrTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate").msgclass - AllocationPolicy::NetworkInterface = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.NetworkInterface").msgclass - AllocationPolicy::NetworkPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.NetworkPolicy").msgclass - AllocationPolicy::PlacementPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.PlacementPolicy").msgclass - AllocationPolicy::ProvisioningModel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.AllocationPolicy.ProvisioningModel").enummodule - TaskGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.TaskGroup").msgclass - TaskGroup::SchedulingPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.TaskGroup.SchedulingPolicy").enummodule - ServiceAccount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.ServiceAccount").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/rest.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/rest.rb deleted file mode 100644 index 93079e00031b..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/rest.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/batch/v1/batch_service/rest" -require "google/cloud/batch/v1/bindings_override" -require "google/cloud/batch/v1/version" - -module Google - module Cloud - module Batch - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/batch/v1/rest" - # client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/task_pb.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/task_pb.rb deleted file mode 100644 index 2c30906e6c4d..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/task_pb.rb +++ /dev/null @@ -1,66 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/batch/v1/task.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/batch/v1/volume_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n google/cloud/batch/v1/task.proto\x12\x15google.cloud.batch.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\"google/cloud/batch/v1/volume.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"O\n\x0f\x43omputeResource\x12\x11\n\tcpu_milli\x18\x01 \x01(\x03\x12\x12\n\nmemory_mib\x18\x02 \x01(\x03\x12\x15\n\rboot_disk_mib\x18\x04 \x01(\x03\"\xdb\x01\n\x0bStatusEvent\x12\x0c\n\x04type\x18\x03 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12.\n\nevent_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x0etask_execution\x18\x04 \x01(\x0b\x32$.google.cloud.batch.v1.TaskExecution\x12;\n\ntask_state\x18\x05 \x01(\x0e\x32\'.google.cloud.batch.v1.TaskStatus.State\"\"\n\rTaskExecution\x12\x11\n\texit_code\x18\x01 \x01(\x05\"\xf2\x01\n\nTaskStatus\x12\x36\n\x05state\x18\x01 \x01(\x0e\x32\'.google.cloud.batch.v1.TaskStatus.State\x12\x39\n\rstatus_events\x18\x02 \x03(\x0b\x32\".google.cloud.batch.v1.StatusEvent\"q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0c\n\x08\x41SSIGNED\x10\x02\x12\x0b\n\x07RUNNING\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\r\n\tSUCCEEDED\x10\x05\x12\x0e\n\nUNEXECUTED\x10\x06\"\x9e\x06\n\x08Runnable\x12>\n\tcontainer\x18\x01 \x01(\x0b\x32).google.cloud.batch.v1.Runnable.ContainerH\x00\x12\x38\n\x06script\x18\x02 \x01(\x0b\x32&.google.cloud.batch.v1.Runnable.ScriptH\x00\x12:\n\x07\x62\x61rrier\x18\x06 \x01(\x0b\x32\'.google.cloud.batch.v1.Runnable.BarrierH\x00\x12\x19\n\x0c\x64isplay_name\x18\n \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\x12ignore_exit_status\x18\x03 \x01(\x08\x12\x12\n\nbackground\x18\x04 \x01(\x08\x12\x12\n\nalways_run\x18\x05 \x01(\x08\x12\x37\n\x0b\x65nvironment\x18\x07 \x01(\x0b\x32\".google.cloud.batch.v1.Environment\x12*\n\x07timeout\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12;\n\x06labels\x18\t \x03(\x0b\x32+.google.cloud.batch.v1.Runnable.LabelsEntry\x1a\xcf\x01\n\tContainer\x12\x11\n\timage_uri\x18\x01 \x01(\t\x12\x10\n\x08\x63ommands\x18\x02 \x03(\t\x12\x12\n\nentrypoint\x18\x03 \x01(\t\x12\x0f\n\x07volumes\x18\x07 \x03(\t\x12\x0f\n\x07options\x18\x08 \x01(\t\x12\x1e\n\x16\x62lock_external_network\x18\t \x01(\x08\x12\x10\n\x08username\x18\n \x01(\t\x12\x10\n\x08password\x18\x0b \x01(\t\x12#\n\x16\x65nable_image_streaming\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01\x1a\x33\n\x06Script\x12\x0e\n\x04path\x18\x01 \x01(\tH\x00\x12\x0e\n\x04text\x18\x02 \x01(\tH\x00\x42\t\n\x07\x63ommand\x1a\x17\n\x07\x42\x61rrier\x12\x0c\n\x04name\x18\x01 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x0c\n\nexecutable\"\xfd\x03\n\x08TaskSpec\x12\x32\n\trunnables\x18\x08 \x03(\x0b\x32\x1f.google.cloud.batch.v1.Runnable\x12@\n\x10\x63ompute_resource\x18\x03 \x01(\x0b\x32&.google.cloud.batch.v1.ComputeResource\x12\x33\n\x10max_run_duration\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x17\n\x0fmax_retry_count\x18\x05 \x01(\x05\x12\x42\n\x12lifecycle_policies\x18\t \x03(\x0b\x32&.google.cloud.batch.v1.LifecyclePolicy\x12K\n\x0c\x65nvironments\x18\x06 \x03(\x0b\x32\x31.google.cloud.batch.v1.TaskSpec.EnvironmentsEntryB\x02\x18\x01\x12.\n\x07volumes\x18\x07 \x03(\x0b\x32\x1d.google.cloud.batch.v1.Volume\x12\x37\n\x0b\x65nvironment\x18\n \x01(\x0b\x32\".google.cloud.batch.v1.Environment\x1a\x33\n\x11\x45nvironmentsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8a\x02\n\x0fLifecyclePolicy\x12=\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32-.google.cloud.batch.v1.LifecyclePolicy.Action\x12P\n\x10\x61\x63tion_condition\x18\x02 \x01(\x0b\x32\x36.google.cloud.batch.v1.LifecyclePolicy.ActionCondition\x1a%\n\x0f\x41\x63tionCondition\x12\x12\n\nexit_codes\x18\x01 \x03(\x05\"?\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\x0e\n\nRETRY_TASK\x10\x01\x12\r\n\tFAIL_TASK\x10\x02\"\xc0\x01\n\x04Task\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x31\n\x06status\x18\x02 \x01(\x0b\x32!.google.cloud.batch.v1.TaskStatus:w\xea\x41t\n\x19\x62\x61tch.googleapis.com/Task\x12Wprojects/{project}/locations/{location}/jobs/{job}/taskGroups/{task_group}/tasks/{task}\"\x8f\x03\n\x0b\x45nvironment\x12\x44\n\tvariables\x18\x01 \x03(\x0b\x32\x31.google.cloud.batch.v1.Environment.VariablesEntry\x12Q\n\x10secret_variables\x18\x02 \x03(\x0b\x32\x37.google.cloud.batch.v1.Environment.SecretVariablesEntry\x12I\n\x13\x65ncrypted_variables\x18\x03 \x01(\x0b\x32,.google.cloud.batch.v1.Environment.KMSEnvMap\x1a\x32\n\tKMSEnvMap\x12\x10\n\x08key_name\x18\x01 \x01(\t\x12\x13\n\x0b\x63ipher_text\x18\x02 \x01(\t\x1a\x30\n\x0eVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x36\n\x14SecretVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\xaa\x01\n\x19\x63om.google.cloud.batch.v1B\tTaskProtoP\x01Z/cloud.google.com/go/batch/apiv1/batchpb;batchpb\xa2\x02\x03GCB\xaa\x02\x15Google.Cloud.Batch.V1\xca\x02\x15Google\\Cloud\\Batch\\V1\xea\x02\x18Google::Cloud::Batch::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"], - ["google.protobuf.Duration", "google/protobuf/duration.proto"], - ["google.cloud.batch.v1.Volume", "google/cloud/batch/v1/volume.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Batch - module V1 - ComputeResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.ComputeResource").msgclass - StatusEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.StatusEvent").msgclass - TaskExecution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.TaskExecution").msgclass - TaskStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.TaskStatus").msgclass - TaskStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.TaskStatus.State").enummodule - Runnable = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Runnable").msgclass - Runnable::Container = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Runnable.Container").msgclass - Runnable::Script = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Runnable.Script").msgclass - Runnable::Barrier = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Runnable.Barrier").msgclass - TaskSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.TaskSpec").msgclass - LifecyclePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.LifecyclePolicy").msgclass - LifecyclePolicy::ActionCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.LifecyclePolicy.ActionCondition").msgclass - LifecyclePolicy::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.LifecyclePolicy.Action").enummodule - Task = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Task").msgclass - Environment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Environment").msgclass - Environment::KMSEnvMap = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Environment.KMSEnvMap").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/version.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/version.rb deleted file mode 100644 index d4b9b7eae49d..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/version.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Batch - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/volume_pb.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/volume_pb.rb deleted file mode 100644 index abdf2ab5404e..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/cloud/batch/v1/volume_pb.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/batch/v1/volume.proto - -require 'google/protobuf' - - -descriptor_data = "\n\"google/cloud/batch/v1/volume.proto\x12\x15google.cloud.batch.v1\"\xaa\x01\n\x06Volume\x12)\n\x03nfs\x18\x01 \x01(\x0b\x32\x1a.google.cloud.batch.v1.NFSH\x00\x12)\n\x03gcs\x18\x03 \x01(\x0b\x32\x1a.google.cloud.batch.v1.GCSH\x00\x12\x15\n\x0b\x64\x65vice_name\x18\x06 \x01(\tH\x00\x12\x12\n\nmount_path\x18\x04 \x01(\t\x12\x15\n\rmount_options\x18\x05 \x03(\tB\x08\n\x06source\"*\n\x03NFS\x12\x0e\n\x06server\x18\x01 \x01(\t\x12\x13\n\x0bremote_path\x18\x02 \x01(\t\"\x1a\n\x03GCS\x12\x13\n\x0bremote_path\x18\x01 \x01(\tB\xac\x01\n\x19\x63om.google.cloud.batch.v1B\x0bVolumeProtoP\x01Z/cloud.google.com/go/batch/apiv1/batchpb;batchpb\xa2\x02\x03GCB\xaa\x02\x15Google.Cloud.Batch.V1\xca\x02\x15Google\\Cloud\\Batch\\V1\xea\x02\x18Google::Cloud::Batch::V1b\x06proto3" - -pool = Google::Protobuf::DescriptorPool.generated_pool - -begin - pool.add_serialized_file(descriptor_data) -rescue TypeError - # Compatibility code: will be removed in the next major version. - require 'google/protobuf/descriptor_pb' - parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data) - parsed.clear_dependency - serialized = parsed.class.encode(parsed) - file = pool.add_serialized_file(serialized) - warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}" - imports = [ - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Batch - module V1 - Volume = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.Volume").msgclass - NFS = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.NFS").msgclass - GCS = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.batch.v1.GCS").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1.rb deleted file mode 100644 index f4e79be12505..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/iam/v1/iam_policy" -require "google/cloud/batch/v1/version" - -module Google - module Iam - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/iam/v1" - # client = ::Google::Iam::V1::IAMPolicy::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/iam/v1" - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new - # - module V1 - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/iam/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/bindings_override.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/bindings_override.rb deleted file mode 100644 index 28c509f7998e..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/bindings_override.rb +++ /dev/null @@ -1,100 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/config" - -module Google - module Iam - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/iam/v1/rest" - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Iam"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = Configuration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - - ## - # @private - # Configuration class for the google.iam.v1 package. - # - # This class contains common configuration for all services - # of the google.iam.v1 package. - # - # This configuration is for internal use of the client library classes, - # and it is not intended that the end-users will read or change it. - # - class Configuration - extend ::Gapic::Config - - # @private - # Overrides for http bindings for the RPC of the mixins for this package. - # Services in this package should use these when creating clients for the mixin services. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy.rb deleted file mode 100644 index 545ca13e6168..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,77 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/batch/v1/version" - -require "google/iam/v1/iam_policy/credentials" -require "google/iam/v1/iam_policy/client" -require "google/iam/v1/iam_policy/rest" - -module Google - module Iam - module V1 - ## - # API Overview - # - # - # Manages Identity and Access Management (IAM) policies. - # - # Any implementation of an API that offers access control features - # implements the google.iam.v1.IAMPolicy interface. - # - # ## Data model - # - # Access control is applied when a principal (user or service account), takes - # some action on a resource exposed by a service. Resources, identified by - # URI-like names, are the unit of access control specification. Service - # implementations can choose the granularity of access control and the - # supported permissions for their resources. - # For example one database service may allow access control to be - # specified only at the Table level, whereas another might allow access control - # to also be specified at the Column level. - # - # ## Policy Structure - # - # See google.iam.v1.Policy - # - # This is intentionally not a CRUD style API because access control policies - # are created and deleted implicitly with the resources to which they are - # attached. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/iam/v1/iam_policy" - # client = ::Google::Iam::V1::IAMPolicy::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/iam/v1/iam_policy/rest" - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new - # - module IAMPolicy - end - end - end -end - -helper_path = ::File.join __dir__, "iam_policy", "helpers.rb" -require "google/iam/v1/iam_policy/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/client.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/client.rb deleted file mode 100644 index ffb701065c6f..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/client.rb +++ /dev/null @@ -1,680 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/iam/v1/iam_policy_pb" -require "google/cloud/location" - -module Google - module Iam - module V1 - module IAMPolicy - ## - # Client for the IAMPolicy service. - # - # API Overview - # - # - # Manages Identity and Access Management (IAM) policies. - # - # Any implementation of an API that offers access control features - # implements the google.iam.v1.IAMPolicy interface. - # - # ## Data model - # - # Access control is applied when a principal (user or service account), takes - # some action on a resource exposed by a service. Resources, identified by - # URI-like names, are the unit of access control specification. Service - # implementations can choose the granularity of access control and the - # supported permissions for their resources. - # For example one database service may allow access control to be - # specified only at the Table level, whereas another might allow access control - # to also be specified at the Column level. - # - # ## Policy Structure - # - # See google.iam.v1.Policy - # - # This is intentionally not a CRUD style API because access control policies - # are created and deleted implicitly with the resources to which they are - # attached. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam-meta-api.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :iam_policy_stub - - ## - # Configure the IAMPolicy Client class. - # - # See {::Google::Iam::V1::IAMPolicy::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all IAMPolicy clients - # ::Google::Iam::V1::IAMPolicy::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Iam", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the IAMPolicy Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Iam::V1::IAMPolicy::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @iam_policy_stub.universe_domain - end - - ## - # Create a new IAMPolicy client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Iam::V1::IAMPolicy::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the IAMPolicy client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/iam/v1/iam_policy_services_pb" - - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @iam_policy_stub = ::Gapic::ServiceStub.new( - ::Google::Iam::V1::IAMPolicy::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @iam_policy_stub.endpoint - config.universe_domain = @iam_policy_stub.universe_domain - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - # Service calls - - ## - # Sets the access control policy on the specified resource. Replaces any - # existing policy. - # - # Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_policy_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a resource. - # Returns an empty policy if the resource exists and does not have a policy - # set. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_policy_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on the specified resource. - # If the resource does not exist, this will return an empty set of - # permissions, not a `NOT_FOUND` error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_policy_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - return response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the IAMPolicy API. - # - # This class represents the configuration for IAMPolicy, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Iam::V1::IAMPolicy::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # set_iam_policy to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Iam::V1::IAMPolicy::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.set_iam_policy.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.set_iam_policy.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "iam-meta-api.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the IAMPolicy API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/credentials.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/credentials.rb deleted file mode 100644 index 493fd12e1228..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/credentials.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Iam - module V1 - module IAMPolicy - # Credentials for the IAMPolicy API. - class Credentials < ::Google::Auth::Credentials - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest.rb deleted file mode 100644 index fb49ff04155d..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/batch/v1/version" -require "google/iam/v1/bindings_override" - -require "google/iam/v1/iam_policy/credentials" -require "google/iam/v1/iam_policy/rest/client" - -module Google - module Iam - module V1 - ## - # API Overview - # - # - # Manages Identity and Access Management (IAM) policies. - # - # Any implementation of an API that offers access control features - # implements the google.iam.v1.IAMPolicy interface. - # - # ## Data model - # - # Access control is applied when a principal (user or service account), takes - # some action on a resource exposed by a service. Resources, identified by - # URI-like names, are the unit of access control specification. Service - # implementations can choose the granularity of access control and the - # supported permissions for their resources. - # For example one database service may allow access control to be - # specified only at the Table level, whereas another might allow access control - # to also be specified at the Column level. - # - # ## Policy Structure - # - # See google.iam.v1.Policy - # - # This is intentionally not a CRUD style API because access control policies - # are created and deleted implicitly with the resources to which they are - # attached. - # - # To load this service and instantiate a REST client: - # - # require "google/iam/v1/iam_policy/rest" - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new - # - module IAMPolicy - # Client for the REST transport - module Rest - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/iam/v1/iam_policy/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/client.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/client.rb deleted file mode 100644 index 1bce6d2930a7..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/client.rb +++ /dev/null @@ -1,641 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/iam/v1/iam_policy_pb" -require "google/iam/v1/iam_policy/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Iam - module V1 - module IAMPolicy - module Rest - ## - # REST client for the IAMPolicy service. - # - # API Overview - # - # - # Manages Identity and Access Management (IAM) policies. - # - # Any implementation of an API that offers access control features - # implements the google.iam.v1.IAMPolicy interface. - # - # ## Data model - # - # Access control is applied when a principal (user or service account), takes - # some action on a resource exposed by a service. Resources, identified by - # URI-like names, are the unit of access control specification. Service - # implementations can choose the granularity of access control and the - # supported permissions for their resources. - # For example one database service may allow access control to be - # specified only at the Table level, whereas another might allow access control - # to also be specified at the Column level. - # - # ## Policy Structure - # - # See google.iam.v1.Policy - # - # This is intentionally not a CRUD style API because access control policies - # are created and deleted implicitly with the resources to which they are - # attached. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam-meta-api.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :iam_policy_stub - - ## - # Configure the IAMPolicy Client class. - # - # See {::Google::Iam::V1::IAMPolicy::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all IAMPolicy clients - # ::Google::Iam::V1::IAMPolicy::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Iam", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the IAMPolicy Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Iam::V1::IAMPolicy::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @iam_policy_stub.universe_domain - end - - ## - # Create a new IAMPolicy REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the IAMPolicy client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @iam_policy_stub = ::Google::Iam::V1::IAMPolicy::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @iam_policy_stub.endpoint - config.universe_domain = @iam_policy_stub.universe_domain - config.bindings_override = @config.bindings_override - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - # Service calls - - ## - # Sets the access control policy on the specified resource. Replaces any - # existing policy. - # - # Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.set_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_policy_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a resource. - # Returns an empty policy if the resource exists and does not have a policy - # set. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_iam_policy.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_policy_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on the specified resource. - # If the resource does not exist, this will return an empty set of - # permissions, not a `NOT_FOUND` error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.test_iam_permissions.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Batch::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_policy_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - return result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the IAMPolicy REST API. - # - # This class represents the configuration for IAMPolicy REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Iam::V1::IAMPolicy::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # set_iam_policy to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Iam::V1::IAMPolicy::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.set_iam_policy.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.set_iam_policy.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "iam-meta-api.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the IAMPolicy API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb deleted file mode 100644 index bf0f194c281c..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb +++ /dev/null @@ -1,247 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/iam/v1/iam_policy_pb" - -module Google - module Iam - module V1 - module IAMPolicy - module Rest - ## - # REST service stub for the IAMPolicy service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - raise_faraday_errors: false - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - - yield result, operation if block_given? - result - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^.*$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^.*$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^.*$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/rest.rb b/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/rest.rb deleted file mode 100644 index 04dfb925f559..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/lib/google/iam/v1/rest.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/iam/v1/iam_policy/rest" -require "google/iam/v1/bindings_override" -require "google/cloud/batch/v1/version" - -module Google - module Iam - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/iam/v1/rest" - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new - # - module V1 - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-batch-v1/proto_docs/README.md deleted file mode 100644 index 40b55bf3d716..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Batch V1 Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 2223d8935069..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,420 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index b03587481349..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # An indicator of the behavior of a given field (for example, that a field - # is required in requests, or given as output but ignored as input). - # This **does not** change the behavior in protocol buffers itself; it only - # denotes the behavior and may affect how API tooling handles the field. - # - # Note: This enum **may** receive new values in the future. - module FieldBehavior - # Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0 - - # Specifically denotes a field as optional. - # While all fields in protocol buffers are optional, this may be specified - # for emphasis if appropriate. - OPTIONAL = 1 - - # Denotes a field as required. - # This indicates that the field **must** be provided as part of the request, - # and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2 - - # Denotes a field as output only. - # This indicates that the field is provided in responses, but including the - # field in a request does nothing (the server *must* ignore it and - # *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3 - - # Denotes a field as input only. - # This indicates that the field is provided in requests, and the - # corresponding field is not included in output. - INPUT_ONLY = 4 - - # Denotes a field as immutable. - # This indicates that the field may be set once in a request to create a - # resource, but may not be changed thereafter. - IMMUTABLE = 5 - - # Denotes that a (repeated) field is an unordered list. - # This indicates that the service may provide the elements of the list - # in any arbitrary order, rather than the order the user originally - # provided. Additionally, the list's order may or may not be stable. - UNORDERED_LIST = 6 - - # Denotes that this field returns a non-empty default value if not set. - # This indicates that if the user provides the empty value in a request, - # a non-empty value will be returned. The user will not be aware of what - # non-empty value to expect. - NON_EMPTY_DEFAULT = 7 - - # Denotes that the field in a resource (a message annotated with - # google.api.resource) is used in the resource name to uniquely identify the - # resource. For AIP-compliant APIs, this should only be applied to the - # `name` field on the resource. - # - # This behavior should not be applied to references to other resources within - # the message. - # - # The identifier field of resources often have different field behavior - # depending on the request it is embedded in (e.g. for Create methods name - # is optional and unused, while for Update methods it is required). Instead - # of method-specific annotations, only `IDENTIFIER` is required. - IDENTIFIER = 8 - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/field_info.rb deleted file mode 100644 index d558fed6cef1..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/field_info.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Rich semantic information of an API field beyond basic typing. - # @!attribute [rw] format - # @return [::Google::Api::FieldInfo::Format] - # The standard format of a field value. This does not explicitly configure - # any API consumer, just documents the API's format for the field it is - # applied to. - # @!attribute [rw] referenced_types - # @return [::Array<::Google::Api::TypeReference>] - # The type(s) that the annotated, generic field may represent. - # - # Currently, this must only be used on fields of type `google.protobuf.Any`. - # Supporting other generic types may be considered in the future. - class FieldInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The standard format of a field value. The supported formats are all backed - # by either an RFC defined by the IETF or a Google-defined AIP. - module Format - # Default, unspecified value. - FORMAT_UNSPECIFIED = 0 - - # Universally Unique Identifier, version 4, value as defined by - # https://datatracker.ietf.org/doc/html/rfc4122. The value may be - # normalized to entirely lowercase letters. For example, the value - # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to - # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. - UUID4 = 1 - - # Internet Protocol v4 value as defined by [RFC - # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be - # condensed, with leading zeros in each octet stripped. For example, - # `001.022.233.040` would be condensed to `1.22.233.40`. - IPV4 = 2 - - # Internet Protocol v6 value as defined by [RFC - # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be - # normalized to entirely lowercase letters with zeros compressed, following - # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, - # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. - IPV6 = 3 - - # An IP address in either v4 or v6 format as described by the individual - # values defined herein. See the comments on the IPV4 and IPV6 types for - # allowed normalizations of each. - IPV4_OR_IPV6 = 4 - end - end - - # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. - # @!attribute [rw] type_name - # @return [::String] - # The name of the type that the annotated, generic field may represent. - # If the type is in the same protobuf package, the value can be the simple - # message name e.g., `"MyMessage"`. Otherwise, the value must be the - # fully-qualified message name e.g., `"google.library.v1.Book"`. - # - # If the type(s) are unknown to the service (e.g. the field accepts generic - # user input), use the wildcard `"*"` to denote this behavior. - # - # See [AIP-202](https://google.aip.dev/202#type-references) for more details. - class TypeReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 38b4b61e6061..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # The launch stage as defined by [Google Cloud Platform - # Launch Stages](https://cloud.google.com/terms/launch-stages). - module LaunchStage - # Do not use this default value. - LAUNCH_STAGE_UNSPECIFIED = 0 - - # The feature is not yet implemented. Users can not use it. - UNIMPLEMENTED = 6 - - # Prelaunch features are hidden from users and are only visible internally. - PRELAUNCH = 7 - - # Early Access features are limited to a closed group of testers. To use - # these features, you must sign up in advance and sign a Trusted Tester - # agreement (which includes confidentiality provisions). These features may - # be unstable, changed in backward-incompatible ways, and are not - # guaranteed to be released. - EARLY_ACCESS = 1 - - # Alpha is a limited availability test for releases before they are cleared - # for widespread use. By Alpha, all significant design issues are resolved - # and we are in the process of verifying functionality. Alpha customers - # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don't have to be feature complete, - # no SLAs are provided, and there are no technical support obligations, but - # they will be far enough along that customers can actually use them in - # test environments or for limited-use tests -- just like they would in - # normal production cases. - ALPHA = 2 - - # Beta is the point at which we are ready to open a release for any - # customer to use. There are no SLA or technical support obligations in a - # Beta release. Products will be complete from a feature perspective, but - # may have some open outstanding issues. Beta releases are suitable for - # limited production use cases. - BETA = 3 - - # GA features are open to all developers and are considered stable and - # fully qualified for production use. - GA = 4 - - # Deprecated features are scheduled to be shut down and removed. For more - # information, see the "Deprecation Policy" section of our [Terms of - # Service](https://cloud.google.com/terms/) - # and the [Google Cloud Platform Subject to the Deprecation - # Policy](https://cloud.google.com/terms/deprecation) documentation. - DEPRECATED = 5 - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 935946d52792..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # A simple descriptor of a resource type. - # - # ResourceDescriptor annotates a resource message (either by means of a - # protobuf annotation or use in the service config), and associates the - # resource's schema, the resource type, and the pattern of the resource name. - # - # Example: - # - # message Topic { - # // Indicates this message defines a resource schema. - # // Declares the resource type in the format of {service}/{kind}. - # // For Kubernetes resources, the format is {api group}/{kind}. - # option (google.api.resource) = { - # type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: "pubsub.googleapis.com/Topic" - # pattern: "projects/{project}/topics/{topic}" - # - # Sometimes, resources have multiple patterns, typically because they can - # live under multiple parents. - # - # Example: - # - # message LogEntry { - # option (google.api.resource) = { - # type: "logging.googleapis.com/LogEntry" - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # }; - # } - # - # The ResourceDescriptor Yaml config will look like: - # - # resources: - # - type: 'logging.googleapis.com/LogEntry' - # pattern: "projects/{project}/logs/{log}" - # pattern: "folders/{folder}/logs/{log}" - # pattern: "organizations/{organization}/logs/{log}" - # pattern: "billingAccounts/{billing_account}/logs/{log}" - # @!attribute [rw] type - # @return [::String] - # The resource type. It must be in the format of - # \\{service_name}/\\{resource_type_kind}. The `resource_type_kind` must be - # singular and must not include version numbers. - # - # Example: `storage.googleapis.com/Bucket` - # - # The value of the resource_type_kind must follow the regular expression - # /[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and - # should use PascalCase (UpperCamelCase). The maximum number of - # characters allowed for the `resource_type_kind` is 100. - # @!attribute [rw] pattern - # @return [::Array<::String>] - # Optional. The relative resource name pattern associated with this resource - # type. The DNS prefix of the full resource name shouldn't be specified here. - # - # The path pattern must follow the syntax, which aligns with HTTP binding - # syntax: - # - # Template = Segment { "/" Segment } ; - # Segment = LITERAL | Variable ; - # Variable = "{" LITERAL "}" ; - # - # Examples: - # - # - "projects/\\{project}/topics/\\{topic}" - # - "projects/\\{project}/knowledgeBases/\\{knowledge_base}" - # - # The components in braces correspond to the IDs for each resource in the - # hierarchy. It is expected that, if multiple patterns are provided, - # the same component name (e.g. "project") refers to IDs of the same - # type of resource. - # @!attribute [rw] name_field - # @return [::String] - # Optional. The field on the resource that designates the resource name - # field. If omitted, this is assumed to be "name". - # @!attribute [rw] history - # @return [::Google::Api::ResourceDescriptor::History] - # Optional. The historical or future-looking state of the resource pattern. - # - # Example: - # - # // The InspectTemplate message originally only supported resource - # // names with organization, and project was added later. - # message InspectTemplate { - # option (google.api.resource) = { - # type: "dlp.googleapis.com/InspectTemplate" - # pattern: - # "organizations/{organization}/inspectTemplates/{inspect_template}" - # pattern: "projects/{project}/inspectTemplates/{inspect_template}" - # history: ORIGINALLY_SINGLE_PATTERN - # }; - # } - # @!attribute [rw] plural - # @return [::String] - # The plural name used in the resource name and permission names, such as - # 'projects' for the resource name of 'projects/\\{project}' and the permission - # name of 'cloudresourcemanager.googleapis.com/projects.get'. One exception - # to this is for Nested Collections that have stuttering names, as defined - # in [AIP-122](https://google.aip.dev/122#nested-collections), where the - # collection ID in the resource name pattern does not necessarily directly - # match the `plural` value. - # - # It is the same concept of the `plural` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # - # Note: The plural form is required even for singleton resources. See - # https://aip.dev/156 - # @!attribute [rw] singular - # @return [::String] - # The same concept of the `singular` field in k8s CRD spec - # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/ - # Such as "project" for the `resourcemanager.googleapis.com/Project` type. - # @!attribute [rw] style - # @return [::Array<::Google::Api::ResourceDescriptor::Style>] - # Style flag(s) for this resource. - # These indicate that a resource is expected to conform to a given - # style. See the specific style flags for additional information. - class ResourceDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A description of the historical or future-looking state of the - # resource pattern. - module History - # The "unset" value. - HISTORY_UNSPECIFIED = 0 - - # The resource originally had one pattern and launched as such, and - # additional patterns were added later. - ORIGINALLY_SINGLE_PATTERN = 1 - - # The resource has one pattern, but the API owner expects to add more - # later. (This is the inverse of ORIGINALLY_SINGLE_PATTERN, and prevents - # that from being necessary once there are multiple patterns.) - FUTURE_MULTI_PATTERN = 2 - end - - # A flag representing a specific style that a resource claims to conform to. - module Style - # The unspecified value. Do not use. - STYLE_UNSPECIFIED = 0 - - # This resource is intended to be "declarative-friendly". - # - # Declarative-friendly resources must be more strictly consistent, and - # setting this to true communicates to tools that this resource should - # adhere to declarative-friendly expectations. - # - # Note: This is used by the API linter (linter.aip.dev) to enable - # additional checks. - DECLARATIVE_FRIENDLY = 1 - end - end - - # Defines a proto annotation that describes a string field that refers to - # an API resource. - # @!attribute [rw] type - # @return [::String] - # The resource type that the annotated field references. - # - # Example: - # - # message Subscription { - # string topic = 2 [(google.api.resource_reference) = { - # type: "pubsub.googleapis.com/Topic" - # }]; - # } - # - # Occasionally, a field may reference an arbitrary resource. In this case, - # APIs use the special value * in their resource reference. - # - # Example: - # - # message GetIamPolicyRequest { - # string resource = 2 [(google.api.resource_reference) = { - # type: "*" - # }]; - # } - # @!attribute [rw] child_type - # @return [::String] - # The resource type of a child collection that the annotated field - # references. This is useful for annotating the `parent` field that - # doesn't have a fixed resource type. - # - # Example: - # - # message ListLogEntriesRequest { - # string parent = 1 [(google.api.resource_reference) = { - # child_type: "logging.googleapis.com/LogEntry" - # }; - # } - class ResourceReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/batch.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/batch.rb deleted file mode 100644 index fcc79d00334b..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/batch.rb +++ /dev/null @@ -1,215 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Batch - module V1 - # CreateJob Request. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name where the Job will be created. - # Pattern: "projects/\\{project}/locations/\\{location}" - # @!attribute [rw] job_id - # @return [::String] - # ID used to uniquely identify the Job within its parent scope. - # This field should contain at most 63 characters and must start with - # lowercase characters. - # Only lowercase characters, numbers and '-' are accepted. - # The '-' character cannot be the first or the last one. - # A system generated ID will be used if the field is not set. - # - # The job.name field in the request will be ignored and the created resource - # name of the Job will be "\\{parent}/jobs/\\{job_id}". - # @!attribute [rw] job - # @return [::Google::Cloud::Batch::V1::Job] - # Required. The Job to create. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # GetJob Request. - # @!attribute [rw] name - # @return [::String] - # Required. Job name. - class GetJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # DeleteJob Request. - # @!attribute [rw] name - # @return [::String] - # Job name. - # @!attribute [rw] reason - # @return [::String] - # Optional. Reason for this deletion. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ListJob Request. - # @!attribute [rw] parent - # @return [::String] - # Parent path. - # @!attribute [rw] filter - # @return [::String] - # List filter. - # @!attribute [rw] order_by - # @return [::String] - # Optional. Sort results. Supported are "name", "name desc", "create_time", - # and "create_time desc". - # @!attribute [rw] page_size - # @return [::Integer] - # Page size. - # @!attribute [rw] page_token - # @return [::String] - # Page token. - class ListJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ListJob Response. - # @!attribute [rw] jobs - # @return [::Array<::Google::Cloud::Batch::V1::Job>] - # Jobs. - # @!attribute [rw] next_page_token - # @return [::String] - # Next page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ListTasks Request. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of a TaskGroup from which Tasks are being requested. - # Pattern: - # "projects/\\{project}/locations/\\{location}/jobs/\\{job}/taskGroups/\\{task_group}" - # @!attribute [rw] filter - # @return [::String] - # Task filter, null filter matches all Tasks. - # Filter string should be of the format State=TaskStatus.State e.g. - # State=RUNNING - # @!attribute [rw] page_size - # @return [::Integer] - # Page size. - # @!attribute [rw] page_token - # @return [::String] - # Page token. - class ListTasksRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ListTasks Response. - # @!attribute [rw] tasks - # @return [::Array<::Google::Cloud::Batch::V1::Task>] - # Tasks. - # @!attribute [rw] next_page_token - # @return [::String] - # Next page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListTasksResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for a single Task by name. - # @!attribute [rw] name - # @return [::String] - # Required. Task name. - class GetTaskRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of the long-running operation. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the operation. - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] status_message - # @return [::String] - # Output only. Human-readable status of the operation, if any. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. Operations that have successfully been cancelled - # have [Operation.error][] value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to - # `Code.CANCELLED`. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/job.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/job.rb deleted file mode 100644 index a7863d2554da..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/job.rb +++ /dev/null @@ -1,743 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Batch - module V1 - # The Cloud Batch Job description. - # @!attribute [r] name - # @return [::String] - # Output only. Job name. - # For example: "projects/123456/locations/us-central1/jobs/job01". - # @!attribute [r] uid - # @return [::String] - # Output only. A system generated unique ID for the Job. - # @!attribute [rw] priority - # @return [::Integer] - # Priority of the Job. - # The valid value range is [0, 100). Default value is 0. - # Higher value indicates higher priority. - # A job with higher priority value is more likely to run earlier if all other - # requirements are satisfied. - # @!attribute [rw] task_groups - # @return [::Array<::Google::Cloud::Batch::V1::TaskGroup>] - # Required. TaskGroups in the Job. Only one TaskGroup is supported now. - # @!attribute [rw] allocation_policy - # @return [::Google::Cloud::Batch::V1::AllocationPolicy] - # Compute resource allocation for all TaskGroups in the Job. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels for the Job. Labels could be user provided or system generated. - # For example, - # "labels": { - # "department": "finance", - # "environment": "test" - # } - # You can assign up to 64 labels. [Google Compute Engine label - # restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) - # apply. - # Label names that start with "goog-" or "google-" are reserved. - # @!attribute [r] status - # @return [::Google::Cloud::Batch::V1::JobStatus] - # Output only. Job status. It is read only for users. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. When the Job was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last time the Job was updated. - # @!attribute [rw] logs_policy - # @return [::Google::Cloud::Batch::V1::LogsPolicy] - # Log preservation policy for the Job. - # @!attribute [rw] notifications - # @return [::Array<::Google::Cloud::Batch::V1::JobNotification>] - # Notification configurations. - class Job - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # LogsPolicy describes how outputs from a Job's Tasks (stdout/stderr) will be - # preserved. - # @!attribute [rw] destination - # @return [::Google::Cloud::Batch::V1::LogsPolicy::Destination] - # Where logs should be saved. - # @!attribute [rw] logs_path - # @return [::String] - # The path to which logs are saved when the destination = PATH. This can be a - # local file path on the VM, or under the mount point of a Persistent Disk or - # Filestore, or a Cloud Storage path. - # @!attribute [rw] cloud_logging_option - # @return [::Google::Cloud::Batch::V1::LogsPolicy::CloudLoggingOption] - # Optional. Additional settings for Cloud Logging. It will only take effect - # when the destination of `LogsPolicy` is set to `CLOUD_LOGGING`. - class LogsPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # `CloudLoggingOption` contains additional settings for Cloud Logging logs - # generated by Batch job. - # @!attribute [rw] use_generic_task_monitored_resource - # @return [::Boolean] - # Optional. Set this flag to true to change the [monitored resource - # type](https://cloud.google.com/monitoring/api/resources) for - # Cloud Logging logs generated by this Batch job from - # the - # [`batch.googleapis.com/Job`](https://cloud.google.com/monitoring/api/resources#tag_batch.googleapis.com/Job) - # type to the formerly used - # [`generic_task`](https://cloud.google.com/monitoring/api/resources#tag_generic_task) - # type. - class CloudLoggingOption - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The destination (if any) for logs. - module Destination - # Logs are not preserved. - DESTINATION_UNSPECIFIED = 0 - - # Logs are streamed to Cloud Logging. - CLOUD_LOGGING = 1 - - # Logs are saved to a file path. - PATH = 2 - end - end - - # Job status. - # @!attribute [rw] state - # @return [::Google::Cloud::Batch::V1::JobStatus::State] - # Job state - # @!attribute [rw] status_events - # @return [::Array<::Google::Cloud::Batch::V1::StatusEvent>] - # Job status events - # @!attribute [rw] task_groups - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Batch::V1::JobStatus::TaskGroupStatus}] - # Aggregated task status for each TaskGroup in the Job. - # The map key is TaskGroup ID. - # @!attribute [rw] run_duration - # @return [::Google::Protobuf::Duration] - # The duration of time that the Job spent in status RUNNING. - class JobStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # VM instance status. - # @!attribute [rw] machine_type - # @return [::String] - # The Compute Engine machine type. - # @!attribute [rw] provisioning_model - # @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel] - # The VM instance provisioning model. - # @!attribute [rw] task_pack - # @return [::Integer] - # The max number of tasks can be assigned to this instance type. - # @!attribute [rw] boot_disk - # @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk] - # The VM boot disk. - class InstanceStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Aggregated task status for a TaskGroup. - # @!attribute [rw] counts - # @return [::Google::Protobuf::Map{::String => ::Integer}] - # Count of task in each state in the TaskGroup. - # The map key is task state name. - # @!attribute [rw] instances - # @return [::Array<::Google::Cloud::Batch::V1::JobStatus::InstanceStatus>] - # Status of instances allocated for the TaskGroup. - class TaskGroupStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Integer] - class CountsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::Batch::V1::JobStatus::TaskGroupStatus] - class TaskGroupsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Valid Job states. - module State - # Job state unspecified. - STATE_UNSPECIFIED = 0 - - # Job is admitted (validated and persisted) and waiting for resources. - QUEUED = 1 - - # Job is scheduled to run as soon as resource allocation is ready. - # The resource allocation may happen at a later time but with a high - # chance to succeed. - SCHEDULED = 2 - - # Resource allocation has been successful. At least one Task in the Job is - # RUNNING. - RUNNING = 3 - - # All Tasks in the Job have finished successfully. - SUCCEEDED = 4 - - # At least one Task in the Job has failed. - FAILED = 5 - - # The Job will be deleted, but has not been deleted yet. Typically this is - # because resources used by the Job are still being cleaned up. - DELETION_IN_PROGRESS = 6 - end - end - - # Notification configurations. - # @!attribute [rw] pubsub_topic - # @return [::String] - # The Pub/Sub topic where notifications for the job, like state - # changes, will be published. If undefined, no Pub/Sub notifications - # are sent for this job. - # - # Specify the topic using the following format: - # `projects/{project}/topics/{topic}`. - # Notably, if you want to specify a Pub/Sub topic that is in a - # different project than the job, your administrator must grant your - # project's Batch service agent permission to publish to that topic. - # - # For more information about configuring Pub/Sub notifications for - # a job, see - # https://cloud.google.com/batch/docs/enable-notifications. - # @!attribute [rw] message - # @return [::Google::Cloud::Batch::V1::JobNotification::Message] - # The attribute requirements of messages to be sent to this Pub/Sub topic. - # Without this field, no message will be sent. - class JobNotification - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message details. - # Describe the conditions under which messages will be sent. - # If no attribute is defined, no message will be sent by default. - # One message should specify either the job or the task level attributes, - # but not both. For example, - # job level: JOB_STATE_CHANGED and/or a specified new_job_state; - # task level: TASK_STATE_CHANGED and/or a specified new_task_state. - # @!attribute [rw] type - # @return [::Google::Cloud::Batch::V1::JobNotification::Type] - # The message type. - # @!attribute [rw] new_job_state - # @return [::Google::Cloud::Batch::V1::JobStatus::State] - # The new job state. - # @!attribute [rw] new_task_state - # @return [::Google::Cloud::Batch::V1::TaskStatus::State] - # The new task state. - class Message - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The message type. - module Type - # Unspecified. - TYPE_UNSPECIFIED = 0 - - # Notify users that the job state has changed. - JOB_STATE_CHANGED = 1 - - # Notify users that the task state has changed. - TASK_STATE_CHANGED = 2 - end - end - - # A Job's resource allocation policy describes when, where, and how compute - # resources should be allocated for the Job. - # @!attribute [rw] location - # @return [::Google::Cloud::Batch::V1::AllocationPolicy::LocationPolicy] - # Location where compute resources should be allocated for the Job. - # @!attribute [rw] instances - # @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicyOrTemplate>] - # Describe instances that can be created by this AllocationPolicy. - # Only instances[0] is supported now. - # @!attribute [rw] service_account - # @return [::Google::Cloud::Batch::V1::ServiceAccount] - # Defines the service account for Batch-created VMs. If omitted, the [default - # Compute Engine service - # account](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) - # is used. Must match the service account specified in any used instance - # template configured in the Batch job. - # - # Includes the following fields: - # * email: The service account's email address. If not set, the default - # Compute Engine service account is used. - # * scopes: Additional OAuth scopes to grant the service account, beyond the - # default cloud-platform scope. (list of strings) - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels applied to all VM instances and other resources - # created by AllocationPolicy. - # Labels could be user provided or system generated. - # You can assign up to 64 labels. [Google Compute Engine label - # restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) - # apply. - # Label names that start with "goog-" or "google-" are reserved. - # @!attribute [rw] network - # @return [::Google::Cloud::Batch::V1::AllocationPolicy::NetworkPolicy] - # The network policy. - # - # If you define an instance template in the `InstancePolicyOrTemplate` field, - # Batch will use the network settings in the instance template instead of - # this field. - # @!attribute [rw] placement - # @return [::Google::Cloud::Batch::V1::AllocationPolicy::PlacementPolicy] - # The placement policy. - # @!attribute [rw] tags - # @return [::Array<::String>] - # Optional. Tags applied to the VM instances. - # - # The tags identify valid sources or targets for network firewalls. - # Each tag must be 1-63 characters long, and comply with - # [RFC1035](https://www.ietf.org/rfc/rfc1035.txt). - class AllocationPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] allowed_locations - # @return [::Array<::String>] - # A list of allowed location names represented by internal URLs. - # - # Each location can be a region or a zone. - # Only one region or multiple zones in one region is supported now. - # For example, - # ["regions/us-central1"] allow VMs in any zones in region us-central1. - # ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs - # in zones us-central1-a and us-central1-c. - # - # Mixing locations from different regions would cause errors. - # For example, - # ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b", - # "zones/us-west1-a"] contains locations from two distinct regions: - # us-central1 and us-west1. This combination will trigger an error. - class LocationPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A new persistent disk or a local ssd. - # A VM can only have one local SSD setting but multiple local SSD partitions. - # See https://cloud.google.com/compute/docs/disks#pdspecs and - # https://cloud.google.com/compute/docs/disks#localssds. - # @!attribute [rw] image - # @return [::String] - # URL for a VM image to use as the data source for this disk. - # For example, the following are all valid URLs: - # - # * Specify the image by its family name: - # projects/\\{project}/global/images/family/\\{image_family} - # * Specify the image version: - # projects/\\{project}/global/images/\\{image_version} - # - # You can also use Batch customized image in short names. - # The following image values are supported for a boot disk: - # - # * `batch-debian`: use Batch Debian images. - # * `batch-cos`: use Batch Container-Optimized images. - # * `batch-hpc-rocky`: use Batch HPC Rocky Linux images. - # @!attribute [rw] snapshot - # @return [::String] - # Name of a snapshot used as the data source. - # Snapshot is not supported as boot disk now. - # @!attribute [rw] type - # @return [::String] - # Disk type as shown in `gcloud compute disk-types list`. - # For example, local SSD uses type "local-ssd". - # Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd" - # or "pd-standard". If not specified, "pd-standard" will be used as the - # default type for non-boot disks, "pd-balanced" will be used as the - # default type for boot disks. - # @!attribute [rw] size_gb - # @return [::Integer] - # Disk size in GB. - # - # **Non-Boot Disk**: - # If the `type` specifies a persistent disk, this field - # is ignored if `data_source` is set as `image` or `snapshot`. - # If the `type` specifies a local SSD, this field should be a multiple of - # 375 GB, otherwise, the final size will be the next greater multiple of - # 375 GB. - # - # **Boot Disk**: - # Batch will calculate the boot disk size based on source - # image and task requirements if you do not speicify the size. - # If both this field and the `boot_disk_mib` field in task spec's - # `compute_resource` are defined, Batch will only honor this field. - # Also, this field should be no smaller than the source disk's - # size when the `data_source` is set as `snapshot` or `image`. - # For example, if you set an image as the `data_source` field and the - # image's default disk size 30 GB, you can only use this field to make the - # disk larger or equal to 30 GB. - # @!attribute [rw] disk_interface - # @return [::String] - # Local SSDs are available through both "SCSI" and "NVMe" interfaces. - # If not indicated, "NVMe" will be the default one for local ssds. - # This field is ignored for persistent disks as the interface is chosen - # automatically. See - # https://cloud.google.com/compute/docs/disks/persistent-disks#choose_an_interface. - class Disk - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A new or an existing persistent disk (PD) or a local ssd attached to a VM - # instance. - # @!attribute [rw] new_disk - # @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk] - # @!attribute [rw] existing_disk - # @return [::String] - # Name of an existing PD. - # @!attribute [rw] device_name - # @return [::String] - # Device name that the guest operating system will see. - # It is used by Runnable.volumes field to mount disks. So please specify - # the device_name if you want Batch to help mount the disk, and it should - # match the device_name field in volumes. - class AttachedDisk - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Accelerator describes Compute Engine accelerators to be attached to the VM. - # @!attribute [rw] type - # @return [::String] - # The accelerator type. For example, "nvidia-tesla-t4". - # See `gcloud compute accelerator-types list`. - # @!attribute [rw] count - # @return [::Integer] - # The number of accelerators of this type. - # @!attribute [rw] install_gpu_drivers - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Boolean] - # Deprecated: please use instances[0].install_gpu_drivers instead. - # @!attribute [rw] driver_version - # @return [::String] - # Optional. The NVIDIA GPU driver version that should be installed for this - # type. - # - # You can define the specific driver version such as "470.103.01", - # following the driver version requirements in - # https://cloud.google.com/compute/docs/gpus/install-drivers-gpu#minimum-driver. - # Batch will install the specific accelerator driver if qualified. - class Accelerator - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # InstancePolicy describes an instance type and resources attached to each VM - # created by this InstancePolicy. - # @!attribute [rw] machine_type - # @return [::String] - # The Compute Engine machine type. - # @!attribute [rw] min_cpu_platform - # @return [::String] - # The minimum CPU platform. - # See - # https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. - # @!attribute [rw] provisioning_model - # @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel] - # The provisioning model. - # @!attribute [rw] accelerators - # @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>] - # The accelerators attached to each VM instance. - # @!attribute [rw] boot_disk - # @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk] - # Boot disk to be created and attached to each VM by this InstancePolicy. - # Boot disk will be deleted when the VM is deleted. - # Batch API now only supports booting from image. - # @!attribute [rw] disks - # @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>] - # Non-boot disks to be attached for each VM created by this InstancePolicy. - # New disks will be deleted when the VM is deleted. - # A non-boot disk is a disk that can be of a device with a - # file system or a raw storage drive that is not ready for data - # storage and accessing. - # @!attribute [rw] reservation - # @return [::String] - # Optional. If specified, VMs will consume only the specified reservation. - # If not specified (default), VMs will consume any applicable reservation. - class InstancePolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # InstancePolicyOrTemplate lets you define the type of resources to use for - # this job either with an InstancePolicy or an instance template. - # If undefined, Batch picks the type of VM to use and doesn't include - # optional VM resources such as GPUs and extra disks. - # @!attribute [rw] policy - # @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy] - # InstancePolicy. - # @!attribute [rw] instance_template - # @return [::String] - # Name of an instance template used to create VMs. - # Named the field as 'instance_template' instead of 'template' to avoid - # c++ keyword conflict. - # @!attribute [rw] install_gpu_drivers - # @return [::Boolean] - # Set this field true if you want Batch to help fetch drivers from a third - # party location and install them for GPUs specified in - # `policy.accelerators` or `instance_template` on your behalf. Default is - # false. - # - # For Container-Optimized Image cases, Batch will install the - # accelerator driver following milestones of - # https://cloud.google.com/container-optimized-os/docs/release-notes. For - # non Container-Optimized Image cases, following - # https://github.com/GoogleCloudPlatform/compute-gpu-installation/blob/main/linux/install_gpu_driver.py. - # @!attribute [rw] install_ops_agent - # @return [::Boolean] - # Optional. Set this field true if you want Batch to install Ops Agent on - # your behalf. Default is false. - # @!attribute [rw] block_project_ssh_keys - # @return [::Boolean] - # Optional. Set this field to `true` if you want Batch to block - # project-level SSH keys from accessing this job's VMs. Alternatively, you - # can configure the job to specify a VM instance template that blocks - # project-level SSH keys. In either case, Batch blocks project-level SSH - # keys while creating the VMs for this job. - # - # Batch allows project-level SSH keys for a job's VMs only if all - # the following are true: - # - # + This field is undefined or set to `false`. - # + The job's VM instance template (if any) doesn't block project-level - # SSH keys. - # - # Notably, you can override this behavior by manually updating a VM to - # block or allow project-level SSH keys. For more information about - # blocking project-level SSH keys, see the Compute Engine documentation: - # https://cloud.google.com/compute/docs/connect/restrict-ssh-keys#block-keys - class InstancePolicyOrTemplate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A network interface. - # @!attribute [rw] network - # @return [::String] - # The URL of an existing network resource. - # You can specify the network as a full or partial URL. - # - # For example, the following are all valid URLs: - # - # * https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network} - # * projects/\\{project}/global/networks/\\{network} - # * global/networks/\\{network} - # @!attribute [rw] subnetwork - # @return [::String] - # The URL of an existing subnetwork resource in the network. - # You can specify the subnetwork as a full or partial URL. - # - # For example, the following are all valid URLs: - # - # * https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork} - # * projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork} - # * regions/\\{region}/subnetworks/\\{subnetwork} - # @!attribute [rw] no_external_ip_address - # @return [::Boolean] - # Default is false (with an external IP address). Required if - # no external public IP address is attached to the VM. If no external - # public IP address, additional configuration is required to allow the VM - # to access Google Services. See - # https://cloud.google.com/vpc/docs/configure-private-google-access and - # https://cloud.google.com/nat/docs/gce-example#create-nat for more - # information. - class NetworkInterface - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # NetworkPolicy describes VM instance network configurations. - # @!attribute [rw] network_interfaces - # @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>] - # Network configurations. - class NetworkPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # PlacementPolicy describes a group placement policy for the VMs controlled - # by this AllocationPolicy. - # @!attribute [rw] collocation - # @return [::String] - # UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you - # want VMs to be located close to each other for low network latency - # between the VMs. No placement policy will be generated when collocation - # is UNSPECIFIED. - # @!attribute [rw] max_distance - # @return [::Integer] - # When specified, causes the job to fail if more than max_distance logical - # switches are required between VMs. Batch uses the most compact possible - # placement of VMs even when max_distance is not specified. An explicit - # max_distance makes that level of compactness a strict requirement. - # Not yet implemented - class PlacementPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Compute Engine VM instance provisioning model. - module ProvisioningModel - # Unspecified. - PROVISIONING_MODEL_UNSPECIFIED = 0 - - # Standard VM. - STANDARD = 1 - - # SPOT VM. - SPOT = 2 - - # Preemptible VM (PVM). - # - # Above SPOT VM is the preferable model for preemptible VM instances: the - # old preemptible VM model (indicated by this field) is the older model, - # and has been migrated to use the SPOT model as the underlying technology. - # This old model will still be supported. - PREEMPTIBLE = 3 - end - end - - # A TaskGroup defines one or more Tasks that all share the same TaskSpec. - # @!attribute [r] name - # @return [::String] - # Output only. TaskGroup name. - # The system generates this field based on parent Job name. - # For example: - # "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01". - # @!attribute [rw] task_spec - # @return [::Google::Cloud::Batch::V1::TaskSpec] - # Required. Tasks in the group share the same task spec. - # @!attribute [rw] task_count - # @return [::Integer] - # Number of Tasks in the TaskGroup. - # Default is 1. - # @!attribute [rw] parallelism - # @return [::Integer] - # Max number of tasks that can run in parallel. - # Default to min(task_count, parallel tasks per job limit). - # See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits). - # Field parallelism must be 1 if the scheduling_policy is IN_ORDER. - # @!attribute [rw] scheduling_policy - # @return [::Google::Cloud::Batch::V1::TaskGroup::SchedulingPolicy] - # Scheduling policy for Tasks in the TaskGroup. - # The default value is AS_SOON_AS_POSSIBLE. - # @!attribute [rw] task_environments - # @return [::Array<::Google::Cloud::Batch::V1::Environment>] - # An array of environment variable mappings, which are passed to Tasks with - # matching indices. If task_environments is used then task_count should - # not be specified in the request (and will be ignored). Task count will be - # the length of task_environments. - # - # Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in - # addition to any environment variables set in task_environments, specifying - # the number of Tasks in the Task's parent TaskGroup, and the specific Task's - # index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). - # @!attribute [rw] task_count_per_node - # @return [::Integer] - # Max number of tasks that can be run on a VM at the same time. - # If not specified, the system will decide a value based on available - # compute resources on a VM and task requirements. - # @!attribute [rw] require_hosts_file - # @return [::Boolean] - # When true, Batch will populate a file with a list of all VMs assigned to - # the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path - # of that file. Defaults to false. The host file supports up to 1000 VMs. - # @!attribute [rw] permissive_ssh - # @return [::Boolean] - # When true, Batch will configure SSH to allow passwordless login between - # VMs running the Batch tasks in the same TaskGroup. - # @!attribute [rw] run_as_non_root - # @return [::Boolean] - # Optional. If not set or set to false, Batch uses the root user to execute - # runnables. If set to true, Batch runs the runnables using a non-root user. - # Currently, the non-root user Batch used is generated by OS Login. For more - # information, see [About OS - # Login](https://cloud.google.com/compute/docs/oslogin). - class TaskGroup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # How Tasks in the TaskGroup should be scheduled relative to each other. - module SchedulingPolicy - # Unspecified. - SCHEDULING_POLICY_UNSPECIFIED = 0 - - # Run Tasks as soon as resources are available. - # - # Tasks might be executed in parallel depending on parallelism and - # task_count values. - AS_SOON_AS_POSSIBLE = 1 - - # Run Tasks sequentially with increased task index. - IN_ORDER = 2 - end - end - - # Carries information about a Google Cloud service account. - # @!attribute [rw] email - # @return [::String] - # Email address of the service account. - # @!attribute [rw] scopes - # @return [::Array<::String>] - # List of scopes to be enabled for this service account. - class ServiceAccount - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/task.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/task.rb deleted file mode 100644 index 3602cd75311a..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/task.rb +++ /dev/null @@ -1,537 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Batch - module V1 - # Compute resource requirements. - # - # ComputeResource defines the amount of resources required for each task. - # Make sure your tasks have enough resources to successfully run. - # If you also define the types of resources for a job to use with the - # [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) - # field, make sure both fields are compatible with each other. - # @!attribute [rw] cpu_milli - # @return [::Integer] - # The milliCPU count. - # - # `cpuMilli` defines the amount of CPU resources per task in milliCPU units. - # For example, `1000` corresponds to 1 vCPU per task. If undefined, the - # default value is `2000`. - # - # If you also define the VM's machine type using the `machineType` in - # [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) - # field or inside the `instanceTemplate` in the - # [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) - # field, make sure the CPU resources for both fields are compatible with each - # other and with how many tasks you want to allow to run on the same VM at - # the same time. - # - # For example, if you specify the `n2-standard-2` machine type, which has 2 - # vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or - # you are recommended to run two tasks on the same VM if you set `cpuMilli` - # to `1000` or less. - # @!attribute [rw] memory_mib - # @return [::Integer] - # Memory in MiB. - # - # `memoryMib` defines the amount of memory per task in MiB units. - # If undefined, the default value is `2000`. - # If you also define the VM's machine type using the `machineType` in - # [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy) - # field or inside the `instanceTemplate` in the - # [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate) - # field, make sure the memory resources for both fields are compatible with - # each other and with how many tasks you want to allow to run on the same VM - # at the same time. - # - # For example, if you specify the `n2-standard-2` machine type, which has 8 - # GiB each, you are recommended to set `memoryMib` to no more than `8192`, - # or you are recommended to run two tasks on the same VM if you set - # `memoryMib` to `4096` or less. - # @!attribute [rw] boot_disk_mib - # @return [::Integer] - # Extra boot disk size in MiB for each task. - class ComputeResource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Status event. - # @!attribute [rw] type - # @return [::String] - # Type of the event. - # @!attribute [rw] description - # @return [::String] - # Description of the event. - # @!attribute [rw] event_time - # @return [::Google::Protobuf::Timestamp] - # The time this event occurred. - # @!attribute [rw] task_execution - # @return [::Google::Cloud::Batch::V1::TaskExecution] - # Task Execution. - # This field is only defined for task-level status events where the task - # fails. - # @!attribute [rw] task_state - # @return [::Google::Cloud::Batch::V1::TaskStatus::State] - # Task State. - # This field is only defined for task-level status events. - class StatusEvent - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This Task Execution field includes detail information for - # task execution procedures, based on StatusEvent types. - # @!attribute [rw] exit_code - # @return [::Integer] - # The exit code of a finished task. - # - # If the task succeeded, the exit code will be 0. If the task failed but not - # due to the following reasons, the exit code will be 50000. - # - # Otherwise, it can be from different sources: - # * Batch known failures: - # https://cloud.google.com/batch/docs/troubleshooting#reserved-exit-codes. - # * Batch runnable execution failures; you can rely on Batch logs to further - # diagnose: https://cloud.google.com/batch/docs/analyze-job-using-logs. If - # there are multiple runnables failures, Batch only exposes the first error. - class TaskExecution - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Status of a task. - # @!attribute [rw] state - # @return [::Google::Cloud::Batch::V1::TaskStatus::State] - # Task state. - # @!attribute [rw] status_events - # @return [::Array<::Google::Cloud::Batch::V1::StatusEvent>] - # Detailed info about why the state is reached. - class TaskStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Task states. - module State - # Unknown state. - STATE_UNSPECIFIED = 0 - - # The Task is created and waiting for resources. - PENDING = 1 - - # The Task is assigned to at least one VM. - ASSIGNED = 2 - - # The Task is running. - RUNNING = 3 - - # The Task has failed. - FAILED = 4 - - # The Task has succeeded. - SUCCEEDED = 5 - - # The Task has not been executed when the Job finishes. - UNEXECUTED = 6 - end - end - - # Runnable describes instructions for executing a specific script or container - # as part of a Task. - # @!attribute [rw] container - # @return [::Google::Cloud::Batch::V1::Runnable::Container] - # Container runnable. - # @!attribute [rw] script - # @return [::Google::Cloud::Batch::V1::Runnable::Script] - # Script runnable. - # @!attribute [rw] barrier - # @return [::Google::Cloud::Batch::V1::Runnable::Barrier] - # Barrier runnable. - # @!attribute [rw] display_name - # @return [::String] - # Optional. DisplayName is an optional field that can be provided by the - # caller. If provided, it will be used in logs and other outputs to identify - # the script, making it easier for users to understand the logs. If not - # provided the index of the runnable will be used for outputs. - # @!attribute [rw] ignore_exit_status - # @return [::Boolean] - # Normally, a runnable that returns a non-zero exit status fails and causes - # the task to fail. However, you can set this field to `true` to allow the - # task to continue executing its other runnables even if this runnable - # fails. - # @!attribute [rw] background - # @return [::Boolean] - # Normally, a runnable that doesn't exit causes its task to fail. However, - # you can set this field to `true` to configure a background runnable. - # Background runnables are allowed continue running in the background while - # the task executes subsequent runnables. For example, background runnables - # are useful for providing services to other runnables or providing - # debugging-support tools like SSH servers. - # - # Specifically, background runnables are killed automatically (if they have - # not already exited) a short time after all foreground runnables have - # completed. Even though this is likely to result in a non-zero exit status - # for the background runnable, these automatic kills are not treated as task - # failures. - # @!attribute [rw] always_run - # @return [::Boolean] - # By default, after a Runnable fails, no further Runnable are executed. This - # flag indicates that this Runnable must be run even if the Task has already - # failed. This is useful for Runnables that copy output files off of the VM - # or for debugging. - # - # The always_run flag does not override the Task's overall max_run_duration. - # If the max_run_duration has expired then no further Runnables will execute, - # not even always_run Runnables. - # @!attribute [rw] environment - # @return [::Google::Cloud::Batch::V1::Environment] - # Environment variables for this Runnable (overrides variables set for the - # whole Task or TaskGroup). - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # Timeout for this Runnable. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels for this Runnable. - class Runnable - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Container runnable. - # @!attribute [rw] image_uri - # @return [::String] - # Required. The URI to pull the container image from. - # @!attribute [rw] commands - # @return [::Array<::String>] - # Required for some container images. Overrides the `CMD` specified in the - # container. If there is an `ENTRYPOINT` (either in the container image or - # with the `entrypoint` field below) then these commands are appended as - # arguments to the `ENTRYPOINT`. - # @!attribute [rw] entrypoint - # @return [::String] - # Required for some container images. Overrides the `ENTRYPOINT` specified - # in the container. - # @!attribute [rw] volumes - # @return [::Array<::String>] - # Volumes to mount (bind mount) from the host machine files or directories - # into the container, formatted to match `--volume` option for the - # `docker run` command—for example, `/foo:/bar` or `/foo:/bar:ro`. - # - # If the `TaskSpec.Volumes` field is specified but this field is not, Batch - # will mount each volume from the host machine to the container with the - # same mount path by default. In this case, the default mount option for - # containers will be read-only (`ro`) for existing persistent disks and - # read-write (`rw`) for other volume types, regardless of the original - # mount options specified in `TaskSpec.Volumes`. If you need different - # mount settings, you can explicitly configure them in this field. - # @!attribute [rw] options - # @return [::String] - # Required for some container images. Arbitrary additional options to - # include in the `docker run` command when running this container—for - # example, `--network host`. For the `--volume` option, use the `volumes` - # field for the container. - # @!attribute [rw] block_external_network - # @return [::Boolean] - # If set to true, external network access to and from container will be - # blocked, containers that are with block_external_network as true can - # still communicate with each other, network cannot be specified in the - # `container.options` field. - # @!attribute [rw] username - # @return [::String] - # Required if the container image is from a private Docker registry. The - # username to login to the Docker registry that contains the image. - # - # You can either specify the username directly by using plain text or - # specify an encrypted username by using a Secret Manager secret: - # `projects/*/secrets/*/versions/*`. However, using a secret is - # recommended for enhanced security. - # - # Caution: If you specify the username using plain text, you risk the - # username being exposed to any users who can view the job or its logs. - # To avoid this risk, specify a secret that contains the username instead. - # - # Learn more about [Secret - # Manager](https://cloud.google.com/secret-manager/docs/) and [using - # Secret Manager with - # Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). - # @!attribute [rw] password - # @return [::String] - # Required if the container image is from a private Docker registry. The - # password to login to the Docker registry that contains the image. - # - # For security, it is strongly recommended to specify an - # encrypted password by using a Secret Manager secret: - # `projects/*/secrets/*/versions/*`. - # - # Warning: If you specify the password using plain text, you risk the - # password being exposed to any users who can view the job or its logs. - # To avoid this risk, specify a secret that contains the password instead. - # - # Learn more about [Secret - # Manager](https://cloud.google.com/secret-manager/docs/) and [using - # Secret Manager with - # Batch](https://cloud.google.com/batch/docs/create-run-job-secret-manager). - # @!attribute [rw] enable_image_streaming - # @return [::Boolean] - # Optional. If set to true, this container runnable uses Image streaming. - # - # Use Image streaming to allow the runnable to initialize without - # waiting for the entire container image to download, which can - # significantly reduce startup time for large container images. - # - # When `enableImageStreaming` is set to true, the container - # runtime is [containerd](https://containerd.io/) instead of Docker. - # Additionally, this container runnable only supports the following - # `container` subfields: `imageUri`, - # `commands[]`, `entrypoint`, and - # `volumes[]`; any other `container` subfields are ignored. - # - # For more information about the requirements and limitations for using - # Image streaming with Batch, see the [`image-streaming` - # sample on - # GitHub](https://github.com/GoogleCloudPlatform/batch-samples/tree/main/api-samples/image-streaming). - class Container - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Script runnable. - # @!attribute [rw] path - # @return [::String] - # The path to a script file that is accessible from the host VM(s). - # - # Unless the script file supports the default `#!/bin/sh` shell - # interpreter, you must specify an interpreter by including a - # [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) as the - # first line of the file. For example, to execute the script using bash, - # include `#!/bin/bash` as the first line of the file. Alternatively, - # to execute the script using Python3, include `#!/usr/bin/env python3` - # as the first line of the file. - # @!attribute [rw] text - # @return [::String] - # The text for a script. - # - # Unless the script text supports the default `#!/bin/sh` shell - # interpreter, you must specify an interpreter by including a - # [shebang line](https://en.wikipedia.org/wiki/Shebang_(Unix) at the - # beginning of the text. For example, to execute the script using bash, - # include `#!/bin/bash\n` at the beginning of the text. Alternatively, - # to execute the script using Python3, include `#!/usr/bin/env python3\n` - # at the beginning of the text. - class Script - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A barrier runnable automatically blocks the execution of subsequent - # runnables until all the tasks in the task group reach the barrier. - # @!attribute [rw] name - # @return [::String] - # Barriers are identified by their index in runnable list. - # Names are not required, but if present should be an identifier. - class Barrier - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Spec of a task - # @!attribute [rw] runnables - # @return [::Array<::Google::Cloud::Batch::V1::Runnable>] - # Required. The sequence of one or more runnables (executable scripts, - # executable containers, and/or barriers) for each task in this task group to - # run. Each task runs this list of runnables in order. For a task to succeed, - # all of its script and container runnables each must meet at least one of - # the following conditions: - # - # + The runnable exited with a zero status. - # + The runnable didn't finish, but you enabled its `background` subfield. - # + The runnable exited with a non-zero status, but you enabled its - # `ignore_exit_status` subfield. - # @!attribute [rw] compute_resource - # @return [::Google::Cloud::Batch::V1::ComputeResource] - # ComputeResource requirements. - # @!attribute [rw] max_run_duration - # @return [::Google::Protobuf::Duration] - # Maximum duration the task should run before being automatically retried - # (if enabled) or automatically failed. Format the value of this field - # as a time limit in seconds followed by `s`—for example, `3600s` - # for 1 hour. The field accepts any value between 0 and the maximum listed - # for the `Duration` field type at - # https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, - # the actual maximum run time for a job will be limited to the maximum run - # time for a job listed at - # https://cloud.google.com/batch/quotas#max-job-duration. - # @!attribute [rw] max_retry_count - # @return [::Integer] - # Maximum number of retries on failures. - # The default, 0, which means never retry. - # The valid value range is [0, 10]. - # @!attribute [rw] lifecycle_policies - # @return [::Array<::Google::Cloud::Batch::V1::LifecyclePolicy>] - # Lifecycle management schema when any task in a task group is failed. - # Currently we only support one lifecycle policy. - # When the lifecycle policy condition is met, - # the action in the policy will execute. - # If task execution result does not meet with the defined lifecycle - # policy, we consider it as the default policy. - # Default policy means if the exit code is 0, exit task. - # If task ends with non-zero exit code, retry the task with max_retry_count. - # @!attribute [rw] environments - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Protobuf::Map{::String => ::String}] - # Deprecated: please use environment(non-plural) instead. - # @!attribute [rw] volumes - # @return [::Array<::Google::Cloud::Batch::V1::Volume>] - # Volumes to mount before running Tasks using this TaskSpec. - # @!attribute [rw] environment - # @return [::Google::Cloud::Batch::V1::Environment] - # Environment variables to set before running the Task. - class TaskSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class EnvironmentsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # LifecyclePolicy describes how to deal with task failures - # based on different conditions. - # @!attribute [rw] action - # @return [::Google::Cloud::Batch::V1::LifecyclePolicy::Action] - # Action to execute when ActionCondition is true. - # When RETRY_TASK is specified, we will retry failed tasks - # if we notice any exit code match and fail tasks if no match is found. - # Likewise, when FAIL_TASK is specified, we will fail tasks - # if we notice any exit code match and retry tasks if no match is found. - # @!attribute [rw] action_condition - # @return [::Google::Cloud::Batch::V1::LifecyclePolicy::ActionCondition] - # Conditions that decide why a task failure is dealt with a specific action. - class LifecyclePolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Conditions for actions to deal with task failures. - # @!attribute [rw] exit_codes - # @return [::Array<::Integer>] - # Exit codes of a task execution. - # If there are more than 1 exit codes, - # when task executes with any of the exit code in the list, - # the condition is met and the action will be executed. - class ActionCondition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Action on task failures based on different conditions. - module Action - # Action unspecified. - ACTION_UNSPECIFIED = 0 - - # Action that tasks in the group will be scheduled to re-execute. - RETRY_TASK = 1 - - # Action that tasks in the group will be stopped immediately. - FAIL_TASK = 2 - end - end - - # A Cloud Batch task. - # @!attribute [rw] name - # @return [::String] - # Task name. - # The name is generated from the parent TaskGroup name and 'id' field. - # For example: - # "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01/tasks/task01". - # @!attribute [rw] status - # @return [::Google::Cloud::Batch::V1::TaskStatus] - # Task Status. - class Task - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An Environment describes a collection of environment variables to set when - # executing Tasks. - # @!attribute [rw] variables - # @return [::Google::Protobuf::Map{::String => ::String}] - # A map of environment variable names to values. - # @!attribute [rw] secret_variables - # @return [::Google::Protobuf::Map{::String => ::String}] - # A map of environment variable names to Secret Manager secret names. - # The VM will access the named secrets to set the value of each environment - # variable. - # @!attribute [rw] encrypted_variables - # @return [::Google::Cloud::Batch::V1::Environment::KMSEnvMap] - # An encrypted JSON dictionary where the key/value pairs correspond to - # environment variable names and their values. - class Environment - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key_name - # @return [::String] - # The name of the KMS key that will be used to decrypt the cipher text. - # @!attribute [rw] cipher_text - # @return [::String] - # The value of the cipherText response from the `encrypt` method. - class KMSEnvMap - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class VariablesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class SecretVariablesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/volume.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/volume.rb deleted file mode 100644 index 9b0dbb7172d8..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/volume.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Batch - module V1 - # Volume describes a volume and parameters for it to be mounted to a VM. - # @!attribute [rw] nfs - # @return [::Google::Cloud::Batch::V1::NFS] - # A Network File System (NFS) volume. For example, a - # Filestore file share. - # @!attribute [rw] gcs - # @return [::Google::Cloud::Batch::V1::GCS] - # A Google Cloud Storage (GCS) volume. - # @!attribute [rw] device_name - # @return [::String] - # Device name of an attached disk volume, which should align with a - # device_name specified by - # job.allocation_policy.instances[0].policy.disks[i].device_name or - # defined by the given instance template in - # job.allocation_policy.instances[0].instance_template. - # @!attribute [rw] mount_path - # @return [::String] - # The mount path for the volume, e.g. /mnt/disks/share. - # @!attribute [rw] mount_options - # @return [::Array<::String>] - # Mount options vary based on the type of storage volume: - # - # * For a Cloud Storage bucket, all the mount options provided - # by - # the [`gcsfuse` tool](https://cloud.google.com/storage/docs/gcsfuse-cli) - # are supported. - # * For an existing persistent disk, all mount options provided by the - # [`mount` command](https://man7.org/linux/man-pages/man8/mount.8.html) - # except writing are supported. This is due to restrictions of - # [multi-writer - # mode](https://cloud.google.com/compute/docs/disks/sharing-disks-between-vms). - # * For any other disk or a Network File System (NFS), all the - # mount options provided by the `mount` command are supported. - class Volume - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents an NFS volume. - # @!attribute [rw] server - # @return [::String] - # The IP address of the NFS. - # @!attribute [rw] remote_path - # @return [::String] - # Remote source path exported from the NFS, e.g., "/share". - class NFS - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a Google Cloud Storage volume. - # @!attribute [rw] remote_path - # @return [::String] - # Remote path, either a bucket name or a subdirectory of a bucket, e.g.: - # bucket_name, bucket_name/subdirectory/ - class GCS - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 3729ce6dfaa5..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index d762967fa7ec..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index a916fb4322c7..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # {::Google::Iam::V1::Binding#members Binding.members}. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 54b83fb82b7d..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal response of the operation in case of success. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc LongRunningRecognize(LongRunningRecognizeRequest) - # returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "LongRunningRecognizeResponse" - # metadata_type: "LongRunningRecognizeMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index fb4d6862eac9..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index b5731a824060..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Duration represents a signed, fixed-length span of time represented - # as a count of seconds and fractions of seconds at nanosecond - # resolution. It is independent of any calendar and concepts like "day" - # or "month". It is related to Timestamp in that the difference between - # two Timestamp values is a Duration and it can be added or subtracted - # from a Timestamp. Range is approximately +-10,000 years. - # - # # Examples - # - # Example 1: Compute Duration from two Timestamps in pseudo code. - # - # Timestamp start = ...; - # Timestamp end = ...; - # Duration duration = ...; - # - # duration.seconds = end.seconds - start.seconds; - # duration.nanos = end.nanos - start.nanos; - # - # if (duration.seconds < 0 && duration.nanos > 0) { - # duration.seconds += 1; - # duration.nanos -= 1000000000; - # } else if (duration.seconds > 0 && duration.nanos < 0) { - # duration.seconds -= 1; - # duration.nanos += 1000000000; - # } - # - # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - # - # Timestamp start = ...; - # Duration duration = ...; - # Timestamp end = ...; - # - # end.seconds = start.seconds + duration.seconds; - # end.nanos = start.nanos + duration.nanos; - # - # if (end.nanos < 0) { - # end.seconds -= 1; - # end.nanos += 1000000000; - # } else if (end.nanos >= 1000000000) { - # end.seconds += 1; - # end.nanos -= 1000000000; - # } - # - # Example 3: Compute Duration from datetime.timedelta in Python. - # - # td = datetime.timedelta(days=3, minutes=10) - # duration = Duration() - # duration.FromTimedelta(td) - # - # # JSON Mapping - # - # In JSON format, the Duration type is encoded as a string rather than an - # object, where the string ends in the suffix "s" (indicating seconds) and - # is preceded by the number of seconds, with nanoseconds expressed as - # fractional seconds. For example, 3 seconds with 0 nanoseconds should be - # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - # microsecond should be expressed in JSON format as "3.000001s". - # @!attribute [rw] seconds - # @return [::Integer] - # Signed seconds of the span of time. Must be from -315,576,000,000 - # to +315,576,000,000 inclusive. Note: these bounds are computed from: - # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - # @!attribute [rw] nanos - # @return [::Integer] - # Signed fractions of a second at nanosecond resolution of the span - # of time. Durations less than one second are represented with a 0 - # `seconds` field and a positive or negative `nanos` field. For durations - # of one second or more, a non-zero value for the `nanos` field must be - # of the same sign as the `seconds` field. Must be from -999,999,999 - # to +999,999,999 inclusive. - class Duration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 8c6b19d52e3d..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A generic empty message that you can re-use to avoid defining duplicated - # empty messages in your APIs. A typical example is to use it as the request - # or the response type of an API method. For instance: - # - # service Foo { - # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); - # } - class Empty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 8e7abcf8f052..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `FieldMask` represents a set of symbolic field paths, for example: - # - # paths: "f.a" - # paths: "f.b.d" - # - # Here `f` represents a field in some root message, `a` and `b` - # fields in the message found in `f`, and `d` a field found in the - # message in `f.b`. - # - # Field masks are used to specify a subset of fields that should be - # returned by a get operation or modified by an update operation. - # Field masks also have a custom JSON encoding (see below). - # - # # Field Masks in Projections - # - # When used in the context of a projection, a response message or - # sub-message is filtered by the API to only contain those fields as - # specified in the mask. For example, if the mask in the previous - # example is applied to a response message as follows: - # - # f { - # a : 22 - # b { - # d : 1 - # x : 2 - # } - # y : 13 - # } - # z: 8 - # - # The result will not contain specific values for fields x,y and z - # (their value will be set to the default, and omitted in proto text - # output): - # - # - # f { - # a : 22 - # b { - # d : 1 - # } - # } - # - # A repeated field is not allowed except at the last position of a - # paths string. - # - # If a FieldMask object is not present in a get operation, the - # operation applies to all fields (as if a FieldMask of all fields - # had been specified). - # - # Note that a field mask does not necessarily apply to the - # top-level response message. In case of a REST get operation, the - # field mask applies directly to the response, but in case of a REST - # list operation, the mask instead applies to each individual message - # in the returned resource list. In case of a REST custom method, - # other definitions may be used. Where the mask applies will be - # clearly documented together with its declaration in the API. In - # any case, the effect on the returned resource/resources is required - # behavior for APIs. - # - # # Field Masks in Update Operations - # - # A field mask in update operations specifies which fields of the - # targeted resource are going to be updated. The API is required - # to only change the values of the fields as specified in the mask - # and leave the others untouched. If a resource is passed in to - # describe the updated values, the API ignores the values of all - # fields not covered by the mask. - # - # If a repeated field is specified for an update operation, new values will - # be appended to the existing repeated field in the target resource. Note that - # a repeated field is only allowed in the last position of a `paths` string. - # - # If a sub-message is specified in the last position of the field mask for an - # update operation, then new value will be merged into the existing sub-message - # in the target resource. - # - # For example, given the target message: - # - # f { - # b { - # d: 1 - # x: 2 - # } - # c: [1] - # } - # - # And an update message: - # - # f { - # b { - # d: 10 - # } - # c: [2] - # } - # - # then if the field mask is: - # - # paths: ["f.b", "f.c"] - # - # then the result will be: - # - # f { - # b { - # d: 10 - # x: 2 - # } - # c: [1, 2] - # } - # - # An implementation may provide options to override this default behavior for - # repeated and message fields. - # - # In order to reset a field's value to the default, the field must - # be in the mask and set to the default value in the provided resource. - # Hence, in order to reset all fields of a resource, provide a default - # instance of the resource and set all fields in the mask, or do - # not provide a mask as described below. - # - # If a field mask is not present on update, the operation applies to - # all fields (as if a field mask of all fields has been specified). - # Note that in the presence of schema evolution, this may mean that - # fields the client does not know and has therefore not filled into - # the request will be reset to their default. If this is unwanted - # behavior, a specific service may require a client to always specify - # a field mask, producing an error if not. - # - # As with get operations, the location of the resource which - # describes the updated values in the request message depends on the - # operation kind. In any case, the effect of the field mask is - # required to be honored by the API. - # - # ## Considerations for HTTP REST - # - # The HTTP kind of an update operation which uses a field mask must - # be set to PATCH instead of PUT in order to satisfy HTTP semantics - # (PUT must only be used for full updates). - # - # # JSON Encoding of Field Masks - # - # In JSON, a field mask is encoded as a single string where paths are - # separated by a comma. Fields name in each path are converted - # to/from lower-camel naming conventions. - # - # As an example, consider the following message declarations: - # - # message Profile { - # User user = 1; - # Photo photo = 2; - # } - # message User { - # string display_name = 1; - # string address = 2; - # } - # - # In proto a field mask for `Profile` may look as such: - # - # mask { - # paths: "user.display_name" - # paths: "photo" - # } - # - # In JSON, the same mask is represented as below: - # - # { - # mask: "user.displayName,photo" - # } - # - # # Field Masks and Oneof Fields - # - # Field masks treat fields in oneofs just as regular fields. Consider the - # following message: - # - # message SampleMessage { - # oneof test_oneof { - # string name = 4; - # SubMessage sub_message = 9; - # } - # } - # - # The field mask can be: - # - # mask { - # paths: "name" - # } - # - # Or: - # - # mask { - # paths: "sub_message" - # } - # - # Note that oneof type names ("test_oneof" in this case) cannot be used in - # paths. - # - # ## Field Mask Verification - # - # The implementation of any API method which has a FieldMask type field in the - # request should verify the included field paths, and return an - # `INVALID_ARGUMENT` error if any path is unmappable. - # @!attribute [rw] paths - # @return [::Array<::String>] - # The set of field mask paths. - class FieldMask - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 4ac9c4801a3f..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # A Timestamp represents a point in time independent of any time zone or local - # calendar, encoded as a count of seconds and fractions of seconds at - # nanosecond resolution. The count is relative to an epoch at UTC midnight on - # January 1, 1970, in the proleptic Gregorian calendar which extends the - # Gregorian calendar backwards to year one. - # - # All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - # second table is needed for interpretation, using a [24-hour linear - # smear](https://developers.google.com/time/smear). - # - # The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - # restricting to that range, we ensure that we can convert to and from [RFC - # 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - # - # # Examples - # - # Example 1: Compute Timestamp from POSIX `time()`. - # - # Timestamp timestamp; - # timestamp.set_seconds(time(NULL)); - # timestamp.set_nanos(0); - # - # Example 2: Compute Timestamp from POSIX `gettimeofday()`. - # - # struct timeval tv; - # gettimeofday(&tv, NULL); - # - # Timestamp timestamp; - # timestamp.set_seconds(tv.tv_sec); - # timestamp.set_nanos(tv.tv_usec * 1000); - # - # Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - # - # FILETIME ft; - # GetSystemTimeAsFileTime(&ft); - # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - # - # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - # Timestamp timestamp; - # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - # - # Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - # - # long millis = System.currentTimeMillis(); - # - # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - # .setNanos((int) ((millis % 1000) * 1000000)).build(); - # - # Example 5: Compute Timestamp from Java `Instant.now()`. - # - # Instant now = Instant.now(); - # - # Timestamp timestamp = - # Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - # .setNanos(now.getNano()).build(); - # - # Example 6: Compute Timestamp from current time in Python. - # - # timestamp = Timestamp() - # timestamp.GetCurrentTime() - # - # # JSON Mapping - # - # In JSON format, the Timestamp type is encoded as a string in the - # [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - # format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z" - # where \\{year} is always expressed using four digits while \\{month}, \\{day}, - # \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional - # seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - # are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - # is required. A proto3 JSON serializer should always use UTC (as indicated by - # "Z") when printing the Timestamp type and a proto3 JSON parser should be - # able to accept both UTC and other timezones (as indicated by an offset). - # - # For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - # 01:30 UTC on January 15, 2017. - # - # In JavaScript, one can convert a Date object to this format using the - # standard - # [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - # method. In Python, a standard `datetime.datetime` object can be converted - # to this format using - # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - # the Joda Time's [`ISODateTimeFormat.dateTime()`]( - # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() - # ) to obtain a formatter capable of generating timestamps in this format. - # @!attribute [rw] seconds - # @return [::Integer] - # Represents seconds of UTC time since Unix epoch - # 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - # 9999-12-31T23:59:59Z inclusive. - # @!attribute [rw] nanos - # @return [::Integer] - # Non-negative fractions of a second at nanosecond resolution. Negative - # second values with fractions must still have non-negative nanos values - # that count forward in time. Must be from 0 to 999,999,999 - # inclusive. - class Timestamp - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index 09acc69b6125..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 41c8c3a565cc..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Type - # Represents a textual expression in the Common Expression Language (CEL) - # syntax. CEL is a C-like expression language. The syntax and semantics of CEL - # are documented at https://github.com/google/cel-spec. - # - # Example (Comparison): - # - # title: "Summary size limit" - # description: "Determines if a summary is less than 100 chars" - # expression: "document.summary.size() < 100" - # - # Example (Equality): - # - # title: "Requestor is owner" - # description: "Determines if requestor is the document owner" - # expression: "document.owner == request.auth.claims.email" - # - # Example (Logic): - # - # title: "Public documents" - # description: "Determine whether the document should be publicly visible" - # expression: "document.type != 'private' && document.type != 'internal'" - # - # Example (Data Manipulation): - # - # title: "Notification string" - # description: "Create a notification string with a timestamp." - # expression: "'New message received at ' + string(document.create_time)" - # - # The exact variables and functions that may be referenced within an expression - # are determined by the service that evaluates it. See the service - # documentation for additional information. - # @!attribute [rw] expression - # @return [::String] - # Textual representation of an expression in Common Expression Language - # syntax. - # @!attribute [rw] title - # @return [::String] - # Optional. Title for the expression, i.e. a short string describing - # its purpose. This can be used e.g. in UIs which allow to enter the - # expression. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the expression. This is a longer text which - # describes the expression, e.g. when hovered over it in a UI. - # @!attribute [rw] location - # @return [::String] - # Optional. String indicating the location of the expression for error - # reporting, e.g. a file name and a position in the file. - class Expr - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-batch-v1/snippets/Gemfile deleted file mode 100644 index 2dda4750a429..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-batch-v1", path: "../" -else - gem "google-cloud-batch-v1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/create_job.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/create_job.rb deleted file mode 100644 index cdf1aa512b45..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/create_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START batch_v1_generated_BatchService_CreateJob_sync] -require "google/cloud/batch/v1" - -## -# Snippet for the create_job call in the BatchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Batch::V1::BatchService::Client#create_job. -# -def create_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Batch::V1::BatchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Batch::V1::CreateJobRequest.new - - # Call the create_job method. - result = client.create_job request - - # The returned object is of type Google::Cloud::Batch::V1::Job. - p result -end -# [END batch_v1_generated_BatchService_CreateJob_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/delete_job.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/delete_job.rb deleted file mode 100644 index 14554d2ae4ec..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/delete_job.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START batch_v1_generated_BatchService_DeleteJob_sync] -require "google/cloud/batch/v1" - -## -# Snippet for the delete_job call in the BatchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Batch::V1::BatchService::Client#delete_job. -# -def delete_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Batch::V1::BatchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Batch::V1::DeleteJobRequest.new - - # Call the delete_job method. - result = client.delete_job request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END batch_v1_generated_BatchService_DeleteJob_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/get_job.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/get_job.rb deleted file mode 100644 index 2041b46cd1c6..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/get_job.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START batch_v1_generated_BatchService_GetJob_sync] -require "google/cloud/batch/v1" - -## -# Snippet for the get_job call in the BatchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Batch::V1::BatchService::Client#get_job. -# -def get_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Batch::V1::BatchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Batch::V1::GetJobRequest.new - - # Call the get_job method. - result = client.get_job request - - # The returned object is of type Google::Cloud::Batch::V1::Job. - p result -end -# [END batch_v1_generated_BatchService_GetJob_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/get_task.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/get_task.rb deleted file mode 100644 index 8b0e54ac3ad6..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/get_task.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START batch_v1_generated_BatchService_GetTask_sync] -require "google/cloud/batch/v1" - -## -# Snippet for the get_task call in the BatchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Batch::V1::BatchService::Client#get_task. -# -def get_task - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Batch::V1::BatchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Batch::V1::GetTaskRequest.new - - # Call the get_task method. - result = client.get_task request - - # The returned object is of type Google::Cloud::Batch::V1::Task. - p result -end -# [END batch_v1_generated_BatchService_GetTask_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/list_jobs.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/list_jobs.rb deleted file mode 100644 index b1e377cb6aa9..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/list_jobs.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START batch_v1_generated_BatchService_ListJobs_sync] -require "google/cloud/batch/v1" - -## -# Snippet for the list_jobs call in the BatchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Batch::V1::BatchService::Client#list_jobs. -# -def list_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Batch::V1::BatchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Batch::V1::ListJobsRequest.new - - # Call the list_jobs method. - result = client.list_jobs request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Batch::V1::Job. - p item - end -end -# [END batch_v1_generated_BatchService_ListJobs_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/list_tasks.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/list_tasks.rb deleted file mode 100644 index f4fd01b5441c..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/snippets/batch_service/list_tasks.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START batch_v1_generated_BatchService_ListTasks_sync] -require "google/cloud/batch/v1" - -## -# Snippet for the list_tasks call in the BatchService service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Cloud::Batch::V1::BatchService::Client#list_tasks. -# -def list_tasks - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Batch::V1::BatchService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Batch::V1::ListTasksRequest.new - - # Call the list_tasks method. - result = client.list_tasks request - - # The returned object is of type Gapic::PagedEnumerable. You can iterate - # over elements, and API calls will be issued to fetch pages as needed. - result.each do |item| - # Each element is of type ::Google::Cloud::Batch::V1::Task. - p item - end -end -# [END batch_v1_generated_BatchService_ListTasks_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/get_iam_policy.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/get_iam_policy.rb deleted file mode 100644 index 9ae1021a14c7..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START batch_v1_generated_IAMPolicy_GetIamPolicy_sync] -require "google/iam/v1" - -## -# Snippet for the get_iam_policy call in the IAMPolicy service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Iam::V1::IAMPolicy::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1::IAMPolicy::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END batch_v1_generated_IAMPolicy_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/set_iam_policy.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/set_iam_policy.rb deleted file mode 100644 index 03dc4613ea22..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START batch_v1_generated_IAMPolicy_SetIamPolicy_sync] -require "google/iam/v1" - -## -# Snippet for the set_iam_policy call in the IAMPolicy service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Iam::V1::IAMPolicy::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1::IAMPolicy::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END batch_v1_generated_IAMPolicy_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/test_iam_permissions.rb b/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/test_iam_permissions.rb deleted file mode 100644 index 3d9d72aae7e9..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/snippets/iam_policy/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START batch_v1_generated_IAMPolicy_TestIamPermissions_sync] -require "google/iam/v1" - -## -# Snippet for the test_iam_permissions call in the IAMPolicy service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Iam::V1::IAMPolicy::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1::IAMPolicy::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END batch_v1_generated_IAMPolicy_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/snippet_metadata_google.cloud.batch.v1.json b/owl-bot-staging/google-cloud-batch-v1/snippets/snippet_metadata_google.cloud.batch.v1.json deleted file mode 100644 index 56107aaba8e6..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/snippets/snippet_metadata_google.cloud.batch.v1.json +++ /dev/null @@ -1,255 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-batch-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.batch.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "batch_v1_generated_BatchService_CreateJob_sync", - "title": "Snippet for the create_job call in the BatchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Batch::V1::BatchService::Client#create_job.", - "file": "batch_service/create_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_job", - "full_name": "::Google::Cloud::Batch::V1::BatchService::Client#create_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Batch::V1::CreateJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Batch::V1::Job", - "client": { - "short_name": "BatchService::Client", - "full_name": "::Google::Cloud::Batch::V1::BatchService::Client" - }, - "method": { - "short_name": "CreateJob", - "full_name": "google.cloud.batch.v1.BatchService.CreateJob", - "service": { - "short_name": "BatchService", - "full_name": "google.cloud.batch.v1.BatchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "batch_v1_generated_BatchService_GetJob_sync", - "title": "Snippet for the get_job call in the BatchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Batch::V1::BatchService::Client#get_job.", - "file": "batch_service/get_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_job", - "full_name": "::Google::Cloud::Batch::V1::BatchService::Client#get_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Batch::V1::GetJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Batch::V1::Job", - "client": { - "short_name": "BatchService::Client", - "full_name": "::Google::Cloud::Batch::V1::BatchService::Client" - }, - "method": { - "short_name": "GetJob", - "full_name": "google.cloud.batch.v1.BatchService.GetJob", - "service": { - "short_name": "BatchService", - "full_name": "google.cloud.batch.v1.BatchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "batch_v1_generated_BatchService_DeleteJob_sync", - "title": "Snippet for the delete_job call in the BatchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Batch::V1::BatchService::Client#delete_job.", - "file": "batch_service/delete_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_job", - "full_name": "::Google::Cloud::Batch::V1::BatchService::Client#delete_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Batch::V1::DeleteJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "BatchService::Client", - "full_name": "::Google::Cloud::Batch::V1::BatchService::Client" - }, - "method": { - "short_name": "DeleteJob", - "full_name": "google.cloud.batch.v1.BatchService.DeleteJob", - "service": { - "short_name": "BatchService", - "full_name": "google.cloud.batch.v1.BatchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "batch_v1_generated_BatchService_ListJobs_sync", - "title": "Snippet for the list_jobs call in the BatchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Batch::V1::BatchService::Client#list_jobs.", - "file": "batch_service/list_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_jobs", - "full_name": "::Google::Cloud::Batch::V1::BatchService::Client#list_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Batch::V1::ListJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Batch::V1::ListJobsResponse", - "client": { - "short_name": "BatchService::Client", - "full_name": "::Google::Cloud::Batch::V1::BatchService::Client" - }, - "method": { - "short_name": "ListJobs", - "full_name": "google.cloud.batch.v1.BatchService.ListJobs", - "service": { - "short_name": "BatchService", - "full_name": "google.cloud.batch.v1.BatchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "batch_v1_generated_BatchService_GetTask_sync", - "title": "Snippet for the get_task call in the BatchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Batch::V1::BatchService::Client#get_task.", - "file": "batch_service/get_task.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_task", - "full_name": "::Google::Cloud::Batch::V1::BatchService::Client#get_task", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Batch::V1::GetTaskRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Batch::V1::Task", - "client": { - "short_name": "BatchService::Client", - "full_name": "::Google::Cloud::Batch::V1::BatchService::Client" - }, - "method": { - "short_name": "GetTask", - "full_name": "google.cloud.batch.v1.BatchService.GetTask", - "service": { - "short_name": "BatchService", - "full_name": "google.cloud.batch.v1.BatchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "batch_v1_generated_BatchService_ListTasks_sync", - "title": "Snippet for the list_tasks call in the BatchService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Batch::V1::BatchService::Client#list_tasks.", - "file": "batch_service/list_tasks.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_tasks", - "full_name": "::Google::Cloud::Batch::V1::BatchService::Client#list_tasks", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Batch::V1::ListTasksRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Batch::V1::ListTasksResponse", - "client": { - "short_name": "BatchService::Client", - "full_name": "::Google::Cloud::Batch::V1::BatchService::Client" - }, - "method": { - "short_name": "ListTasks", - "full_name": "google.cloud.batch.v1.BatchService.ListTasks", - "service": { - "short_name": "BatchService", - "full_name": "google.cloud.batch.v1.BatchService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-batch-v1/snippets/snippet_metadata_google.iam.v1.json b/owl-bot-staging/google-cloud-batch-v1/snippets/snippet_metadata_google.iam.v1.json deleted file mode 100644 index 8e7486b5b5d6..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/snippets/snippet_metadata_google.iam.v1.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-batch-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.iam.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "batch_v1_generated_IAMPolicy_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the IAMPolicy service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#set_iam_policy.", - "file": "iam_policy/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Iam::V1::IAMPolicy::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "IAMPolicy::Client", - "full_name": "::Google::Iam::V1::IAMPolicy::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.iam.v1.IAMPolicy.SetIamPolicy", - "service": { - "short_name": "IAMPolicy", - "full_name": "google.iam.v1.IAMPolicy" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "batch_v1_generated_IAMPolicy_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the IAMPolicy service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#get_iam_policy.", - "file": "iam_policy/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Iam::V1::IAMPolicy::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "IAMPolicy::Client", - "full_name": "::Google::Iam::V1::IAMPolicy::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.iam.v1.IAMPolicy.GetIamPolicy", - "service": { - "short_name": "IAMPolicy", - "full_name": "google.iam.v1.IAMPolicy" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "batch_v1_generated_IAMPolicy_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the IAMPolicy service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#test_iam_permissions.", - "file": "iam_policy/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Iam::V1::IAMPolicy::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "IAMPolicy::Client", - "full_name": "::Google::Iam::V1::IAMPolicy::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.iam.v1.IAMPolicy.TestIamPermissions", - "service": { - "short_name": "IAMPolicy", - "full_name": "google.iam.v1.IAMPolicy" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_operations_test.rb b/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_operations_test.rb deleted file mode 100644 index 1e03eb9e611f..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_operations_test.rb +++ /dev/null @@ -1,389 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/batch/v1/batch_pb" -require "google/cloud/batch/v1/batch_services_pb" -require "google/cloud/batch/v1/batch_service" - -class ::Google::Cloud::Batch::V1::BatchService::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Batch::V1::BatchService::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Batch::V1::BatchService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_paths_test.rb b/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_paths_test.rb deleted file mode 100644 index f1db8831652d..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_paths_test.rb +++ /dev/null @@ -1,83 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/batch/v1/batch_service" - -class ::Google::Cloud::Batch::V1::BatchService::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_job_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.job_path project: "value0", location: "value1", job: "value2" - assert_equal "projects/value0/locations/value1/jobs/value2", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_task_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.task_path project: "value0", location: "value1", job: "value2", task_group: "value3", task: "value4" - assert_equal "projects/value0/locations/value1/jobs/value2/taskGroups/value3/tasks/value4", path - end - end - - def test_task_group_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.task_group_path project: "value0", location: "value1", job: "value2", task_group: "value3" - assert_equal "projects/value0/locations/value1/jobs/value2/taskGroups/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_rest_test.rb b/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_rest_test.rb deleted file mode 100644 index 5859fdf8a5ee..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_rest_test.rb +++ /dev/null @@ -1,427 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/cloud/batch/v1/batch_pb" -require "google/cloud/batch/v1/batch_service/rest" - - -class ::Google::Cloud::Batch::V1::BatchService::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_job - # Create test objects. - client_result = ::Google::Cloud::Batch::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - job_id = "hello world" - job = {} - request_id = "hello world" - - create_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Batch::V1::BatchService::Rest::ServiceStub.stub :transcode_create_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_job_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_job({ parent: parent, job_id: job_id, job: job, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_job parent: parent, job_id: job_id, job: job, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_job ::Google::Cloud::Batch::V1::CreateJobRequest.new(parent: parent, job_id: job_id, job: job, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_job({ parent: parent, job_id: job_id, job: job, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_job(::Google::Cloud::Batch::V1::CreateJobRequest.new(parent: parent, job_id: job_id, job: job, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_job_client_stub.call_count - end - end - end - - def test_get_job - # Create test objects. - client_result = ::Google::Cloud::Batch::V1::Job.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Batch::V1::BatchService::Rest::ServiceStub.stub :transcode_get_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_job ::Google::Cloud::Batch::V1::GetJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_job(::Google::Cloud::Batch::V1::GetJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_job_client_stub.call_count - end - end - end - - def test_delete_job - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - reason = "hello world" - request_id = "hello world" - - delete_job_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Batch::V1::BatchService::Rest::ServiceStub.stub :transcode_delete_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_job({ name: name, reason: reason, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_job name: name, reason: reason, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_job ::Google::Cloud::Batch::V1::DeleteJobRequest.new(name: name, reason: reason, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_job({ name: name, reason: reason, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_job(::Google::Cloud::Batch::V1::DeleteJobRequest.new(name: name, reason: reason, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_job_client_stub.call_count - end - end - end - - def test_list_jobs - # Create test objects. - client_result = ::Google::Cloud::Batch::V1::ListJobsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - order_by = "hello world" - page_size = 42 - page_token = "hello world" - - list_jobs_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Batch::V1::BatchService::Rest::ServiceStub.stub :transcode_list_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_jobs({ parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_jobs parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_jobs ::Google::Cloud::Batch::V1::ListJobsRequest.new(parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_jobs({ parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_jobs(::Google::Cloud::Batch::V1::ListJobsRequest.new(parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_jobs_client_stub.call_count - end - end - end - - def test_get_task - # Create test objects. - client_result = ::Google::Cloud::Batch::V1::Task.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_task_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Batch::V1::BatchService::Rest::ServiceStub.stub :transcode_get_task_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_task_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_task({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_task name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_task ::Google::Cloud::Batch::V1::GetTaskRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_task({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_task(::Google::Cloud::Batch::V1::GetTaskRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_task_client_stub.call_count - end - end - end - - def test_list_tasks - # Create test objects. - client_result = ::Google::Cloud::Batch::V1::ListTasksResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_tasks_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Batch::V1::BatchService::Rest::ServiceStub.stub :transcode_list_tasks_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_tasks_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_tasks({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_tasks parent: parent, filter: filter, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_tasks ::Google::Cloud::Batch::V1::ListTasksRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_tasks({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_tasks(::Google::Cloud::Batch::V1::ListTasksRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_tasks_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Cloud::Batch::V1::BatchService::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Batch::V1::BatchService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_test.rb b/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_test.rb deleted file mode 100644 index f936451a090e..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/test/google/cloud/batch/v1/batch_service_test.rb +++ /dev/null @@ -1,477 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/batch/v1/batch_pb" -require "google/cloud/batch/v1/batch_services_pb" -require "google/cloud/batch/v1/batch_service" - -class ::Google::Cloud::Batch::V1::BatchService::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_create_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Batch::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - job_id = "hello world" - job = {} - request_id = "hello world" - - create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_job, name - assert_kind_of ::Google::Cloud::Batch::V1::CreateJobRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["job_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Batch::V1::Job), request["job"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_job_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_job({ parent: parent, job_id: job_id, job: job, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_job parent: parent, job_id: job_id, job: job, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_job ::Google::Cloud::Batch::V1::CreateJobRequest.new(parent: parent, job_id: job_id, job: job, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_job({ parent: parent, job_id: job_id, job: job, request_id: request_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_job(::Google::Cloud::Batch::V1::CreateJobRequest.new(parent: parent, job_id: job_id, job: job, request_id: request_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_job_client_stub.call_rpc_count - end - end - - def test_get_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::Batch::V1::Job.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_job, name - assert_kind_of ::Google::Cloud::Batch::V1::GetJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_job_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_job ::Google::Cloud::Batch::V1::GetJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_job({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_job(::Google::Cloud::Batch::V1::GetJobRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_job_client_stub.call_rpc_count - end - end - - def test_delete_job - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - reason = "hello world" - request_id = "hello world" - - delete_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_job, name - assert_kind_of ::Google::Cloud::Batch::V1::DeleteJobRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["reason"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_job_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_job({ name: name, reason: reason, request_id: request_id }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_job name: name, reason: reason, request_id: request_id do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_job ::Google::Cloud::Batch::V1::DeleteJobRequest.new(name: name, reason: reason, request_id: request_id) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_job({ name: name, reason: reason, request_id: request_id }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_job(::Google::Cloud::Batch::V1::DeleteJobRequest.new(name: name, reason: reason, request_id: request_id), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_job_client_stub.call_rpc_count - end - end - - def test_list_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Batch::V1::ListJobsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - order_by = "hello world" - page_size = 42 - page_token = "hello world" - - list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_jobs, name - assert_kind_of ::Google::Cloud::Batch::V1::ListJobsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["order_by"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_jobs_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_jobs({ parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_jobs parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_jobs ::Google::Cloud::Batch::V1::ListJobsRequest.new(parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_jobs({ parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_jobs(::Google::Cloud::Batch::V1::ListJobsRequest.new(parent: parent, filter: filter, order_by: order_by, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_jobs_client_stub.call_rpc_count - end - end - - def test_get_task - # Create GRPC objects. - grpc_response = ::Google::Cloud::Batch::V1::Task.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_task, name - assert_kind_of ::Google::Cloud::Batch::V1::GetTaskRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_task_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_task({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_task name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_task ::Google::Cloud::Batch::V1::GetTaskRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_task({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_task(::Google::Cloud::Batch::V1::GetTaskRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_task_client_stub.call_rpc_count - end - end - - def test_list_tasks - # Create GRPC objects. - grpc_response = ::Google::Cloud::Batch::V1::ListTasksResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - - list_tasks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_tasks, name - assert_kind_of ::Google::Cloud::Batch::V1::ListTasksRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_tasks_client_stub do - # Create client - client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_tasks({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_tasks parent: parent, filter: filter, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_tasks ::Google::Cloud::Batch::V1::ListTasksRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_tasks({ parent: parent, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_tasks(::Google::Cloud::Batch::V1::ListTasksRequest.new(parent: parent, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_tasks_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Cloud::Batch::V1::BatchService::Client::Configuration, config - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Batch::V1::BatchService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Batch::V1::BatchService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/test/google/iam/v1/iam_policy_rest_test.rb b/owl-bot-staging/google-cloud-batch-v1/test/google/iam/v1/iam_policy_rest_test.rb deleted file mode 100644 index da6f78f3716b..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/test/google/iam/v1/iam_policy_rest_test.rb +++ /dev/null @@ -1,257 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/iam/v1/iam_policy_pb" -require "google/iam/v1/iam_policy/rest" - - -class ::Google::Iam::V1::IAMPolicy::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {} - make_http_request :get, uri: uri, body: nil, params: params, options: options - end - - def make_delete_request uri:, params: {}, options: {} - make_http_request :delete, uri: uri, body: nil, params: params, options: options - end - - def make_post_request uri:, body: nil, params: {}, options: {} - make_http_request :post, uri: uri, body: body, params: params, options: options - end - - def make_patch_request uri:, body:, params: {}, options: {} - make_http_request :patch, uri: uri, body: body, params: params, options: options - end - - def make_put_request uri:, body:, params: {}, options: {} - make_http_request :put, uri: uri, body: body, params: params, options: options - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Iam::V1::IAMPolicy::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/test/google/iam/v1/iam_policy_test.rb b/owl-bot-staging/google-cloud-batch-v1/test/google/iam/v1/iam_policy_test.rb deleted file mode 100644 index 956f5832d339..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/test/google/iam/v1/iam_policy_test.rb +++ /dev/null @@ -1,258 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/iam/v1/iam_policy_pb" -require "google/iam/v1/iam_policy_services_pb" -require "google/iam/v1/iam_policy" - -class ::Google::Iam::V1::IAMPolicy::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - yield @response, @operation if block_given? - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Iam::V1::IAMPolicy::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-batch-v1/test/helper.rb b/owl-bot-staging/google-cloud-batch-v1/test/helper.rb deleted file mode 100644 index 48407bca7edb..000000000000 --- a/owl-bot-staging/google-cloud-batch-v1/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2024 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"