From 6bc7c1157f45d5dfff82ee6702b6f140b3998743 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 6 Feb 2026 19:05:35 +0000 Subject: [PATCH 1/2] feat: add a DeleteFolderRecursive API definition PiperOrigin-RevId: 866471251 Source-Link: https://github.com/googleapis/googleapis/commit/af8a8d56476983207ac225892b38cc9bfbe744f1 Source-Link: https://github.com/googleapis/googleapis-gen/commit/aab4d11f403e99d8364c34bcd5eda1f8ea00c506 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXN0b3JhZ2UtY29udHJvbC12Mi8uT3dsQm90LnlhbWwiLCJoIjoiYWFiNGQxMWY0MDNlOTlkODM2NGMzNGJjZDVlZGExZjhlYTAwYzUwNiJ9 --- .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../google-cloud-storage-control-v2/.toys.rb | 28 + .../google-cloud-storage-control-v2/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-storage-control-v2/Gemfile | 11 + .../LICENSE.md | 201 + .../google-cloud-storage-control-v2/README.md | 154 + .../google-cloud-storage-control-v2/Rakefile | 169 + .../gapic_metadata.json | 153 + .../google-cloud-storage-control-v2.gemspec | 29 + .../lib/google-cloud-storage-control-v2.rb | 21 + .../lib/google/cloud/storage/control/v2.rb | 47 + .../google/cloud/storage/control/v2/rest.rb | 39 + .../storage/control/v2/storage_control.rb | 58 + .../control/v2/storage_control/client.rb | 3379 +++++++++++++++++ .../control/v2/storage_control/credentials.rb | 53 + .../control/v2/storage_control/operations.rb | 843 ++++ .../control/v2/storage_control/paths.rb | 178 + .../control/v2/storage_control/rest.rb | 54 + .../control/v2/storage_control/rest/client.rb | 913 +++++ .../v2/storage_control/rest/service_stub.rb | 452 +++ .../cloud/storage/control/v2/version.rb | 30 + .../storage/control/v2/storage_control_pb.rb | 107 + .../control/v2/storage_control_services_pb.rb | 125 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 473 +++ .../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/api/routing.rb | 459 +++ .../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 | 191 + .../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 + .../storage/control/v2/storage_control.rb | 1026 +++++ .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + ...et_metadata_google.storage.control.v2.json | 1095 ++++++ .../storage_control/create_anywhere_cache.rb | 54 + .../snippets/storage_control/create_folder.rb | 47 + .../storage_control/create_managed_folder.rb | 47 + .../snippets/storage_control/delete_folder.rb | 47 + .../delete_folder_recursive.rb | 54 + .../storage_control/delete_managed_folder.rb | 47 + .../storage_control/disable_anywhere_cache.rb | 47 + .../storage_control/get_anywhere_cache.rb | 47 + .../snippets/storage_control/get_folder.rb | 47 + .../get_folder_intelligence_config.rb | 47 + .../storage_control/get_iam_policy.rb | 47 + .../storage_control/get_managed_folder.rb | 47 + .../get_organization_intelligence_config.rb | 47 + .../get_project_intelligence_config.rb | 47 + .../storage_control/get_storage_layout.rb | 47 + .../storage_control/list_anywhere_caches.rb | 51 + .../snippets/storage_control/list_folders.rb | 51 + .../storage_control/list_managed_folders.rb | 51 + .../storage_control/pause_anywhere_cache.rb | 47 + .../snippets/storage_control/rename_folder.rb | 54 + .../storage_control/resume_anywhere_cache.rb | 47 + .../storage_control/set_iam_policy.rb | 47 + .../storage_control/test_iam_permissions.rb | 47 + .../storage_control/update_anywhere_cache.rb | 54 + .../update_folder_intelligence_config.rb | 47 + ...update_organization_intelligence_config.rb | 47 + .../update_project_intelligence_config.rb | 47 + .../v2/storage_control_operations_test.rb | 400 ++ .../control/v2/storage_control_paths_test.rb | 121 + .../control/v2/storage_control_rest_test.rb | 429 +++ .../control/v2/storage_control_test.rb | 1853 +++++++++ .../test/helper.rb | 25 + 80 files changed, 16459 insertions(+) create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.gitignore create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.toys.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.yardopts create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/Gemfile create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/README.md create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/Rakefile create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/google-cloud-storage-control-v2.gemspec create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/rest.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/credentials.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/operations.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/paths.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/version.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/routing.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_anywhere_cache.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_folder.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_managed_folder.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder_recursive.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_managed_folder.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/disable_anywhere_cache.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_anywhere_cache.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder_intelligence_config.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_managed_folder.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_organization_intelligence_config.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_project_intelligence_config.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_storage_layout.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_anywhere_caches.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_folders.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_managed_folders.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/pause_anywhere_cache.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/rename_folder.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/resume_anywhere_cache.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_anywhere_cache.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_folder_intelligence_config.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_organization_intelligence_config.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_project_intelligence_config.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb create mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/helper.rb diff --git a/owl-bot-staging/google-cloud-storage-control-v2/.gitignore b/owl-bot-staging/google-cloud-storage-control-v2/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/.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-storage-control-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-storage-control-v2/.repo-metadata.json new file mode 100644 index 000000000000..9dc1067e6b4b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "storage.googleapis.com", + "api_shortname": "storage", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-storage-control-v2/latest", + "distribution_name": "google-cloud-storage-control-v2", + "is_cloud": true, + "language": "ruby", + "name": "storage", + "name_pretty": "Storage Control V2 API", + "product_documentation": "https://cloud.google.com/storage/docs/overview", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "The Google Cloud Storage API allows applications to read and write data through the abstractions of buckets and objects, which are similar to directories and files except that buckets cannot contain other buckets, and directory-level operations (like directory rename) are not supported. Buckets share a single global namespace, and each bucket belongs to a specific project that has an associated owner that pays for the data stored in the bucket. This API is accessed using standard gRPC requests. Note that google-cloud-storage-control-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage-control instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/storage/docs/overview", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-storage-control-v2/.rubocop.yml b/owl-bot-staging/google-cloud-storage-control-v2/.rubocop.yml new file mode 100644 index 000000000000..c9354c029feb --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-storage-control-v2.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-storage-control-v2.rb" diff --git a/owl-bot-staging/google-cloud-storage-control-v2/.toys.rb b/owl-bot-staging/google-cloud-storage-control-v2/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/.toys.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +toys_version! ">= 0.15.3" + +if ENV["RUBY_COMMON_TOOLS"] + common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] + load File.join(common_tools_dir, "toys", "gapic") +else + load_git remote: "https://github.com/googleapis/ruby-common-tools.git", + path: "toys/gapic", + update: true +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/.yardopts b/owl-bot-staging/google-cloud-storage-control-v2/.yardopts new file mode 100644 index 000000000000..e4425bd31ee0 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Storage Control V2 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-storage-control-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-storage-control-v2/AUTHENTICATION.md new file mode 100644 index 000000000000..9672b7b75ce0 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-storage-control-v2 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-storage-control-v2 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/storage/control/v2" + +client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/storage/control/v2" + +::Google::Cloud::Storage::Control::V2::StorageControl::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Storage::Control::V2::StorageControl::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-storage-control-v2 +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/storage/control/v2" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Storage::Control::V2::StorageControl::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-storage-control-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-storage-control-v2/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-storage-control-v2/Gemfile b/owl-bot-staging/google-cloud-storage-control-v2/Gemfile new file mode 100644 index 000000000000..6442df18fa2f --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/Gemfile @@ -0,0 +1,11 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.31.1" +gem "minitest", "~> 5.22" +gem "minitest-focus", "~> 1.4" +gem "minitest-rg", "~> 5.3" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-storage-control-v2/LICENSE.md b/owl-bot-staging/google-cloud-storage-control-v2/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/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-storage-control-v2/README.md b/owl-bot-staging/google-cloud-storage-control-v2/README.md new file mode 100644 index 000000000000..ba465335ff4a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Storage Control V2 API + +The Storage Control API lets you perform metadata-specific, control plane, and long-running operations. The Storage Control API creates one space to perform metadata-specific, control plane, and long-running operations apart from the Storage API. Separating these operations from the Storage API improves API standardization and lets you run faster releases. + +The Google Cloud Storage API allows applications to read and write data through the abstractions of buckets and objects, which are similar to directories and files except that buckets cannot contain other buckets, and directory-level operations (like directory rename) are not supported. Buckets share a single global namespace, and each bucket belongs to a specific project that has an associated owner that pays for the data stored in the bucket. This API is accessed using standard gRPC requests. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Storage Control V2 API. Most users should consider using +the main client gem, +[google-cloud-storage-control](https://rubygems.org/gems/google-cloud-storage-control). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-storage-control-v2 +``` + +## 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/storage.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/storage/control/v2" + +client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new +request = ::Google::Cloud::Storage::Control::V2::CreateFolderRequest.new # (request fields as keyword arguments...) +response = client.create_folder request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-storage-control-v2/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/storage/docs/overview) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/cloud/storage/control/v2" +require "logger" + +client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.logger = Logger.new "my-app.log" +end +``` + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-storage-control`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-storage-control-v2`. +_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-storage-control`. +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-storage-control-v2`. + +### 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-storage-control-v2/Rakefile b/owl-bot-staging/google-cloud-storage-control-v2/Rakefile new file mode 100644 index 000000000000..c1ef5dea7f73 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/Rakefile @@ -0,0 +1,169 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = 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-storage-control-v2 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/storage/control/v2/storage_control/credentials" + ::Google::Cloud::Storage::Control::V2::StorageControl::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-storage-control-v2 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-storage-control-v2 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-storage-control-v2 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-storage-control-v2 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-storage-control-v2" + header "google-cloud-storage-control-v2 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-storage-control-v2 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-storage-control-v2 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-storage-control-v2 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-storage-control-v2 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-storage-control-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-storage-control-v2/gapic_metadata.json new file mode 100644 index 000000000000..c36e20575fbc --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/gapic_metadata.json @@ -0,0 +1,153 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.storage.control.v2", + "libraryPackage": "::Google::Cloud::Storage::Control::V2", + "services": { + "StorageControl": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Storage::Control::V2::StorageControl::Client", + "rpcs": { + "CreateFolder": { + "methods": [ + "create_folder" + ] + }, + "DeleteFolder": { + "methods": [ + "delete_folder" + ] + }, + "GetFolder": { + "methods": [ + "get_folder" + ] + }, + "ListFolders": { + "methods": [ + "list_folders" + ] + }, + "RenameFolder": { + "methods": [ + "rename_folder" + ] + }, + "DeleteFolderRecursive": { + "methods": [ + "delete_folder_recursive" + ] + }, + "GetStorageLayout": { + "methods": [ + "get_storage_layout" + ] + }, + "CreateManagedFolder": { + "methods": [ + "create_managed_folder" + ] + }, + "DeleteManagedFolder": { + "methods": [ + "delete_managed_folder" + ] + }, + "GetManagedFolder": { + "methods": [ + "get_managed_folder" + ] + }, + "ListManagedFolders": { + "methods": [ + "list_managed_folders" + ] + }, + "CreateAnywhereCache": { + "methods": [ + "create_anywhere_cache" + ] + }, + "UpdateAnywhereCache": { + "methods": [ + "update_anywhere_cache" + ] + }, + "DisableAnywhereCache": { + "methods": [ + "disable_anywhere_cache" + ] + }, + "PauseAnywhereCache": { + "methods": [ + "pause_anywhere_cache" + ] + }, + "ResumeAnywhereCache": { + "methods": [ + "resume_anywhere_cache" + ] + }, + "GetAnywhereCache": { + "methods": [ + "get_anywhere_cache" + ] + }, + "ListAnywhereCaches": { + "methods": [ + "list_anywhere_caches" + ] + }, + "GetProjectIntelligenceConfig": { + "methods": [ + "get_project_intelligence_config" + ] + }, + "UpdateProjectIntelligenceConfig": { + "methods": [ + "update_project_intelligence_config" + ] + }, + "GetFolderIntelligenceConfig": { + "methods": [ + "get_folder_intelligence_config" + ] + }, + "UpdateFolderIntelligenceConfig": { + "methods": [ + "update_folder_intelligence_config" + ] + }, + "GetOrganizationIntelligenceConfig": { + "methods": [ + "get_organization_intelligence_config" + ] + }, + "UpdateOrganizationIntelligenceConfig": { + "methods": [ + "update_organization_intelligence_config" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-storage-control-v2/google-cloud-storage-control-v2.gemspec b/owl-bot-staging/google-cloud-storage-control-v2/google-cloud-storage-control-v2.gemspec new file mode 100644 index 000000000000..70edb0b14eed --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/google-cloud-storage-control-v2.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/storage/control/v2/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-storage-control-v2" + gem.version = Google::Cloud::Storage::Control::V2::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "The Google Cloud Storage API allows applications to read and write data through the abstractions of buckets and objects, which are similar to directories and files except that buckets cannot contain other buckets, and directory-level operations (like directory rename) are not supported. Buckets share a single global namespace, and each bucket belongs to a specific project that has an associated owner that pays for the data stored in the bucket. This API is accessed using standard gRPC requests. Note that google-cloud-storage-control-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage-control instead. See the readme for more details." + gem.summary = "The Storage Control API lets you perform metadata-specific, control plane, and long-running operations. The Storage Control API creates one space to perform metadata-specific, control plane, and long-running operations apart from the Storage API. Separating these operations from the Storage API improves API standardization and lets you run faster releases." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `git ls-files -- proto_docs/*`.split("\n") + + ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 3.1" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb new file mode 100644 index 000000000000..c8a5475de0b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# 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/storage/control/v2" diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2.rb new file mode 100644 index 000000000000..b529c031a2e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/storage/control/v2/storage_control" +require "google/cloud/storage/control/v2/version" + +module Google + module Cloud + module Storage + module Control + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/storage/control/v2" + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/storage/control/v2" + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + module V2 + end + end + end + end +end + +helper_path = ::File.join __dir__, "v2", "_helpers.rb" +require "google/cloud/storage/control/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/rest.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/rest.rb new file mode 100644 index 000000000000..8e031b6fa014 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/rest.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/storage/control/v2/storage_control/rest" +require "google/cloud/storage/control/v2/version" + +module Google + module Cloud + module Storage + module Control + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/storage/control/v2/rest" + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + module V2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control.rb new file mode 100644 index 000000000000..4cfe356728f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/storage/control/v2/version" + +require "google/cloud/storage/control/v2/storage_control/credentials" +require "google/cloud/storage/control/v2/storage_control/paths" +require "google/cloud/storage/control/v2/storage_control/operations" +require "google/cloud/storage/control/v2/storage_control/client" +require "google/cloud/storage/control/v2/storage_control/rest" + +module Google + module Cloud + module Storage + module Control + module V2 + ## + # StorageControl service includes selected control plane operations. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/storage/control/v2/storage_control" + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/storage/control/v2/storage_control/rest" + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + module StorageControl + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "storage_control", "helpers.rb" +require "google/cloud/storage/control/v2/storage_control/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb new file mode 100644 index 000000000000..4a311841cf98 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb @@ -0,0 +1,3379 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/storage/control/v2/storage_control_pb" + +module Google + module Cloud + module Storage + module Control + module V2 + module StorageControl + ## + # Client for the StorageControl service. + # + # StorageControl service includes selected control plane operations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storage.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :storage_control_stub + + ## + # Configure the StorageControl Client class. + # + # See {::Google::Cloud::Storage::Control::V2::StorageControl::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all StorageControl clients + # ::Google::Cloud::Storage::Control::V2::StorageControl::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", "Storage", "Control", "V2"] + 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.timeout = 60.0 + + default_config.rpcs.create_folder.timeout = 60.0 + default_config.rpcs.create_folder.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_folder.timeout = 60.0 + default_config.rpcs.get_folder.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.list_folders.timeout = 60.0 + default_config.rpcs.list_folders.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.rename_folder.timeout = 60.0 + default_config.rpcs.rename_folder.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.delete_folder_recursive.timeout = 60.0 + default_config.rpcs.delete_folder_recursive.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_storage_layout.timeout = 60.0 + default_config.rpcs.get_storage_layout.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_managed_folder.timeout = 60.0 + default_config.rpcs.get_managed_folder.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.list_managed_folders.timeout = 60.0 + default_config.rpcs.list_managed_folders.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.create_anywhere_cache.timeout = 60.0 + default_config.rpcs.create_anywhere_cache.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.update_anywhere_cache.timeout = 60.0 + default_config.rpcs.update_anywhere_cache.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.disable_anywhere_cache.timeout = 60.0 + default_config.rpcs.disable_anywhere_cache.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.pause_anywhere_cache.timeout = 60.0 + default_config.rpcs.pause_anywhere_cache.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.resume_anywhere_cache.timeout = 60.0 + default_config.rpcs.resume_anywhere_cache.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_anywhere_cache.timeout = 60.0 + default_config.rpcs.get_anywhere_cache.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.list_anywhere_caches.timeout = 60.0 + default_config.rpcs.list_anywhere_caches.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_project_intelligence_config.timeout = 60.0 + default_config.rpcs.get_project_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.update_project_intelligence_config.timeout = 60.0 + default_config.rpcs.update_project_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_folder_intelligence_config.timeout = 60.0 + default_config.rpcs.get_folder_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.update_folder_intelligence_config.timeout = 60.0 + default_config.rpcs.update_folder_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_organization_intelligence_config.timeout = 60.0 + default_config.rpcs.get_organization_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.update_organization_intelligence_config.timeout = 60.0 + default_config.rpcs.update_organization_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the StorageControl 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::Storage::Control::V2::StorageControl::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 + @storage_control_stub.universe_domain + end + + ## + # Create a new StorageControl client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the StorageControl 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/storage/control/v2/storage_control_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 + + @storage_control_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Storage::Control::V2::StorageControl::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool, + logger: @config.logger + ) + + @storage_control_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Storage::Control::V2::StorageControl::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @storage_control_stub.logger + end + + # Service calls + + ## + # Creates a new folder. This operation is only applicable to a hierarchical + # namespace enabled bucket. + # + # @overload create_folder(request, options = nil) + # Pass arguments to `create_folder` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::CreateFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::CreateFolderRequest, ::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_folder(parent: nil, folder: nil, folder_id: nil, recursive: nil, request_id: nil) + # Pass arguments to `create_folder` 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 the bucket in which the folder will reside. The bucket + # must be a hierarchical namespace enabled bucket. + # @param folder [::Google::Cloud::Storage::Control::V2::Folder, ::Hash] + # Required. Properties of the new folder being created. + # The bucket and name of the folder are specified in the parent and folder_id + # fields, respectively. Populating those fields in `folder` will result in an + # error. + # @param folder_id [::String] + # Required. The full name of a folder, including all its parent folders. + # Folders use single '/' characters as a delimiter. + # The folder_id must end with a slash. + # For example, the folder_id of "books/biographies/" would create a new + # "biographies/" folder under the "books/" folder. + # @param recursive [::Boolean] + # Optional. If true, parent folder doesn't have to be present and all missing + # ancestor folders will be created atomically. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::Folder] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::Folder] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::CreateFolderRequest.new + # + # # Call the create_folder method. + # result = client.create_folder request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::Folder. + # p result + # + def create_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::CreateFolderRequest + + # 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_folder.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::Storage::Control::V2::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 && !request.parent.empty? + header_params["bucket"] = request.parent + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :create_folder, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes an empty folder. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # + # @overload delete_folder(request, options = nil) + # Pass arguments to `delete_folder` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::DeleteFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::DeleteFolderRequest, ::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_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) + # Pass arguments to `delete_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the folder. + # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + # @param if_metageneration_match [::Integer] + # Makes the operation only succeed conditional on whether the folder's + # current metageneration matches the given value. + # @param if_metageneration_not_match [::Integer] + # Makes the operation only succeed conditional on whether the folder's + # current metageneration does not match the given value. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new + # + # # Call the delete_folder method. + # result = client.delete_folder request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest + + # 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_folder.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::Storage::Control::V2::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 + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :delete_folder, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for the specified folder. This operation is only + # applicable to a hierarchical namespace enabled bucket. + # + # @overload get_folder(request, options = nil) + # Pass arguments to `get_folder` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetFolderRequest, ::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_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) + # Pass arguments to `get_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the folder. + # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + # @param if_metageneration_match [::Integer] + # Makes the operation only succeed conditional on whether the folder's + # current metageneration matches the given value. + # @param if_metageneration_not_match [::Integer] + # Makes the operation only succeed conditional on whether the folder's + # current metageneration does not match the given value. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::Folder] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::Folder] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetFolderRequest.new + # + # # Call the get_folder method. + # result = client.get_folder request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::Folder. + # p result + # + def get_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetFolderRequest + + # 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_folder.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::Storage::Control::V2::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 + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :get_folder, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a list of folders. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # + # @overload list_folders(request, options = nil) + # Pass arguments to `list_folders` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::ListFoldersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::ListFoldersRequest, ::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_folders(parent: nil, page_size: nil, page_token: nil, prefix: nil, delimiter: nil, lexicographic_start: nil, lexicographic_end: nil, request_id: nil) + # Pass arguments to `list_folders` 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 the bucket in which to look for folders. The bucket must + # be a hierarchical namespace enabled bucket. + # @param page_size [::Integer] + # Optional. Maximum number of folders to return in a single response. The + # service will use this parameter or 1,000 items, whichever is smaller. + # @param page_token [::String] + # Optional. A previously-returned page token representing part of the larger + # set of results to view. + # @param prefix [::String] + # Optional. Filter results to folders whose names begin with this prefix. + # If set, the value must either be an empty string or end with a '/'. + # @param delimiter [::String] + # Optional. If set, returns results in a directory-like mode. The results + # will only include folders that either exactly match the above prefix, or + # are one level below the prefix. The only supported value is '/'. + # @param lexicographic_start [::String] + # Optional. Filter results to folders whose names are lexicographically equal + # to or after lexicographic_start. If lexicographic_end is also set, the + # folders listed have names between lexicographic_start (inclusive) and + # lexicographic_end (exclusive). + # @param lexicographic_end [::String] + # Optional. Filter results to folders whose names are lexicographically + # before lexicographic_end. If lexicographic_start is also set, the folders + # listed have names between lexicographic_start (inclusive) and + # lexicographic_end (exclusive). + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::Folder>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::Folder>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::ListFoldersRequest.new + # + # # Call the list_folders method. + # result = client.list_folders 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::Storage::Control::V2::Folder. + # p item + # end + # + def list_folders request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListFoldersRequest + + # 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_folders.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::Storage::Control::V2::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 && !request.parent.empty? + header_params["bucket"] = request.parent + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_folders.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_folders.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :list_folders, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @storage_control_stub, :list_folders, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Renames a source folder to a destination folder. This operation is only + # applicable to a hierarchical namespace enabled bucket. During a rename, the + # source and destination folders are locked until the long running operation + # completes. + # + # @overload rename_folder(request, options = nil) + # Pass arguments to `rename_folder` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::RenameFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::RenameFolderRequest, ::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 rename_folder(name: nil, destination_folder_id: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) + # Pass arguments to `rename_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the source folder being renamed. + # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + # @param destination_folder_id [::String] + # Required. The destination folder ID, e.g. `foo/bar/`. + # @param if_metageneration_match [::Integer] + # Makes the operation only succeed conditional on whether the source + # folder's current metageneration matches the given value. + # @param if_metageneration_not_match [::Integer] + # Makes the operation only succeed conditional on whether the source + # folder's current metageneration does not match the given value. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + # + # @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/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::RenameFolderRequest.new + # + # # Call the rename_folder method. + # result = client.rename_folder 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 rename_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::RenameFolderRequest + + # 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.rename_folder.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::Storage::Control::V2::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 + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.rename_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.rename_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :rename_folder, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a folder recursively. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # + # @overload delete_folder_recursive(request, options = nil) + # Pass arguments to `delete_folder_recursive` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest, ::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_folder_recursive(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) + # Pass arguments to `delete_folder_recursive` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the folder being deleted, however all of its contents + # will be deleted too. Format: + # `projects/{project}/buckets/{bucket}/folders/{folder}` + # @param if_metageneration_match [::Integer] + # Optional. Makes the operation only succeed conditional on whether the root + # folder's current metageneration matches the given value. + # @param if_metageneration_not_match [::Integer] + # Optional. Makes the operation only succeed conditional on whether the root + # folder's current metageneration does not match the given value. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @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/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new + # + # # Call the delete_folder_recursive method. + # result = client.delete_folder_recursive 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_folder_recursive request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest + + # 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_folder_recursive.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::Storage::Control::V2::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 + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_folder_recursive.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_folder_recursive.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :delete_folder_recursive, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the storage layout configuration for a given bucket. + # + # @overload get_storage_layout(request, options = nil) + # Pass arguments to `get_storage_layout` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest, ::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_storage_layout(name: nil, prefix: nil, request_id: nil) + # Pass arguments to `get_storage_layout` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the StorageLayout resource. + # Format: `projects/{project}/buckets/{bucket}/storageLayout` + # @param prefix [::String] + # An optional prefix used for permission check. It is useful when the caller + # only has limited permissions under a specific prefix. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::StorageLayout] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::StorageLayout] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new + # + # # Call the get_storage_layout method. + # result = client.get_storage_layout request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::StorageLayout. + # p result + # + def get_storage_layout request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest + + # 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_storage_layout.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::Storage::Control::V2::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 + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_storage_layout.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_storage_layout.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :get_storage_layout, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new managed folder. + # + # @overload create_managed_folder(request, options = nil) + # Pass arguments to `create_managed_folder` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest, ::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_managed_folder(parent: nil, managed_folder: nil, managed_folder_id: nil, request_id: nil) + # Pass arguments to `create_managed_folder` 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 the bucket this managed folder belongs to. + # @param managed_folder [::Google::Cloud::Storage::Control::V2::ManagedFolder, ::Hash] + # Required. Properties of the managed folder being created. + # The bucket and managed folder names are specified in the `parent` and + # `managed_folder_id` fields. Populating these fields in `managed_folder` + # will result in an error. + # @param managed_folder_id [::String] + # Required. The name of the managed folder. It uses a single `/` as delimiter + # and leading and trailing `/` are allowed. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::ManagedFolder] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::ManagedFolder] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest.new + # + # # Call the create_managed_folder method. + # result = client.create_managed_folder request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::ManagedFolder. + # p result + # + def create_managed_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest + + # 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_managed_folder.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::Storage::Control::V2::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 && !request.parent.empty? + header_params["bucket"] = request.parent + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_managed_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_managed_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :create_managed_folder, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Permanently deletes an empty managed folder. + # + # @overload delete_managed_folder(request, options = nil) + # Pass arguments to `delete_managed_folder` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest, ::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_managed_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, allow_non_empty: nil, request_id: nil) + # Pass arguments to `delete_managed_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the managed folder. + # Format: + # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + # @param if_metageneration_match [::Integer] + # The operation succeeds conditional on the managed folder's current + # metageneration matching the value here specified. + # @param if_metageneration_not_match [::Integer] + # The operation succeeds conditional on the managed folder's current + # metageneration NOT matching the value here specified. + # @param allow_non_empty [::Boolean] + # Allows deletion of a managed folder even if it is not empty. + # A managed folder is empty if it manages no child managed folders or + # objects. Caller must have permission for + # storage.managedFolders.setIamPolicy. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest.new + # + # # Call the delete_managed_folder method. + # result = client.delete_managed_folder request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_managed_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest + + # 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_managed_folder.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::Storage::Control::V2::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 + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_managed_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_managed_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :delete_managed_folder, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns metadata for the specified managed folder. + # + # @overload get_managed_folder(request, options = nil) + # Pass arguments to `get_managed_folder` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest, ::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_managed_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) + # Pass arguments to `get_managed_folder` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the managed folder. + # Format: + # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + # @param if_metageneration_match [::Integer] + # The operation succeeds conditional on the managed folder's current + # metageneration matching the value here specified. + # @param if_metageneration_not_match [::Integer] + # The operation succeeds conditional on the managed folder's current + # metageneration NOT matching the value here specified. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::ManagedFolder] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::ManagedFolder] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetManagedFolderRequest.new + # + # # Call the get_managed_folder method. + # result = client.get_managed_folder request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::ManagedFolder. + # p result + # + def get_managed_folder request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest + + # 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_managed_folder.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::Storage::Control::V2::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 + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_managed_folder.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_managed_folder.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :get_managed_folder, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a list of managed folders for a given bucket. + # + # @overload list_managed_folders(request, options = nil) + # Pass arguments to `list_managed_folders` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest, ::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_managed_folders(parent: nil, page_size: nil, page_token: nil, prefix: nil, request_id: nil) + # Pass arguments to `list_managed_folders` 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 the bucket this managed folder belongs to. + # @param page_size [::Integer] + # Optional. Maximum number of managed folders to return in a single response. + # The service will use this parameter or 1,000 items, whichever is smaller. + # @param page_token [::String] + # Optional. A previously-returned page token representing part of the larger + # set of results to view. + # @param prefix [::String] + # Optional. Filter results to match managed folders with name starting with + # this prefix. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::ManagedFolder>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::ManagedFolder>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest.new + # + # # Call the list_managed_folders method. + # result = client.list_managed_folders 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::Storage::Control::V2::ManagedFolder. + # p item + # end + # + def list_managed_folders request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest + + # 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_managed_folders.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::Storage::Control::V2::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 && !request.parent.empty? + header_params["bucket"] = request.parent + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_managed_folders.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_managed_folders.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :list_managed_folders, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @storage_control_stub, :list_managed_folders, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates an Anywhere Cache instance. + # + # @overload create_anywhere_cache(request, options = nil) + # Pass arguments to `create_anywhere_cache` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest, ::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_anywhere_cache(parent: nil, anywhere_cache: nil, request_id: nil) + # Pass arguments to `create_anywhere_cache` 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 bucket to which this cache belongs. + # Format: `projects/{project}/buckets/{bucket}` + # @param anywhere_cache [::Google::Cloud::Storage::Control::V2::AnywhereCache, ::Hash] + # Required. Properties of the Anywhere Cache instance being created. + # The parent bucket name is specified in the `parent` field. Server uses the + # default value of `ttl` or `admission_policy` if not specified in + # request. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + # + # @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/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new + # + # # Call the create_anywhere_cache method. + # result = client.create_anywhere_cache 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 create_anywhere_cache request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest + + # 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_anywhere_cache.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::Storage::Control::V2::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 && !request.parent.empty? + header_params["bucket"] = request.parent + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_anywhere_cache.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_anywhere_cache.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :create_anywhere_cache, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an Anywhere Cache instance. Mutable fields include `ttl` and + # `admission_policy`. + # + # @overload update_anywhere_cache(request, options = nil) + # Pass arguments to `update_anywhere_cache` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_anywhere_cache(anywhere_cache: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_anywhere_cache` 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 anywhere_cache [::Google::Cloud::Storage::Control::V2::AnywhereCache, ::Hash] + # Required. The Anywhere Cache instance to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. List of fields to be updated. Mutable fields of AnywhereCache + # include `ttl` and `admission_policy`. + # + # To specify ALL fields, specify a single field with the value `*`. Note: We + # recommend against doing this. If a new field is introduced at a later time, + # an older client updating with the `*` may accidentally reset the new + # field's value. + # + # Not specifying any fields is an error. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + # + # @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/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new + # + # # Call the update_anywhere_cache method. + # result = client.update_anywhere_cache 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 update_anywhere_cache request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_anywhere_cache.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::Storage::Control::V2::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.anywhere_cache&.name + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.anywhere_cache.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_anywhere_cache.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_anywhere_cache.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :update_anywhere_cache, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Disables an Anywhere Cache instance. A disabled instance is read-only. The + # disablement could be revoked by calling ResumeAnywhereCache. The cache + # instance will be deleted automatically if it remains in the disabled state + # for at least one hour. + # + # @overload disable_anywhere_cache(request, options = nil) + # Pass arguments to `disable_anywhere_cache` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest, ::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 disable_anywhere_cache(name: nil, request_id: nil) + # Pass arguments to `disable_anywhere_cache` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name field in the request should be: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new + # + # # Call the disable_anywhere_cache method. + # result = client.disable_anywhere_cache request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. + # p result + # + def disable_anywhere_cache request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest + + # 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.disable_anywhere_cache.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::Storage::Control::V2::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 + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.disable_anywhere_cache.timeout, + metadata: metadata, + retry_policy: @config.rpcs.disable_anywhere_cache.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :disable_anywhere_cache, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Pauses an Anywhere Cache instance. + # + # @overload pause_anywhere_cache(request, options = nil) + # Pass arguments to `pause_anywhere_cache` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest, ::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 pause_anywhere_cache(name: nil, request_id: nil) + # Pass arguments to `pause_anywhere_cache` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name field in the request should be: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new + # + # # Call the pause_anywhere_cache method. + # result = client.pause_anywhere_cache request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. + # p result + # + def pause_anywhere_cache request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest + + # 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.pause_anywhere_cache.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::Storage::Control::V2::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 + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.pause_anywhere_cache.timeout, + metadata: metadata, + retry_policy: @config.rpcs.pause_anywhere_cache.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :pause_anywhere_cache, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Resumes a disabled or paused Anywhere Cache instance. + # + # @overload resume_anywhere_cache(request, options = nil) + # Pass arguments to `resume_anywhere_cache` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest, ::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 resume_anywhere_cache(name: nil, request_id: nil) + # Pass arguments to `resume_anywhere_cache` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name field in the request should be: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new + # + # # Call the resume_anywhere_cache method. + # result = client.resume_anywhere_cache request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. + # p result + # + def resume_anywhere_cache request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest + + # 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.resume_anywhere_cache.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::Storage::Control::V2::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 + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.resume_anywhere_cache.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resume_anywhere_cache.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :resume_anywhere_cache, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an Anywhere Cache instance. + # + # @overload get_anywhere_cache(request, options = nil) + # Pass arguments to `get_anywhere_cache` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest, ::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_anywhere_cache(name: nil, request_id: nil) + # Pass arguments to `get_anywhere_cache` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name field in the request should be: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new + # + # # Call the get_anywhere_cache method. + # result = client.get_anywhere_cache request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. + # p result + # + def get_anywhere_cache request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest + + # 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_anywhere_cache.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::Storage::Control::V2::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 + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_anywhere_cache.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_anywhere_cache.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :get_anywhere_cache, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists Anywhere Cache instances for a given bucket. + # + # @overload list_anywhere_caches(request, options = nil) + # Pass arguments to `list_anywhere_caches` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest, ::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_anywhere_caches(parent: nil, page_size: nil, page_token: nil, request_id: nil) + # Pass arguments to `list_anywhere_caches` 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 bucket to which this cache belongs. + # @param page_size [::Integer] + # Maximum number of caches to return in a single response. + # The service will use this parameter or 1,000 items, whichever is smaller. + # @param page_token [::String] + # A previously-returned page token representing part of the larger set of + # results to view. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::AnywhereCache>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::AnywhereCache>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new + # + # # Call the list_anywhere_caches method. + # result = client.list_anywhere_caches 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::Storage::Control::V2::AnywhereCache. + # p item + # end + # + def list_anywhere_caches request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest + + # 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_anywhere_caches.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::Storage::Control::V2::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 && !request.parent.empty? + header_params["bucket"] = request.parent + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_anywhere_caches.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_anywhere_caches.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :list_anywhere_caches, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @storage_control_stub, :list_anywhere_caches, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the Project scoped singleton IntelligenceConfig resource. + # + # @overload get_project_intelligence_config(request, options = nil) + # Pass arguments to `get_project_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, ::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_project_intelligence_config(name: nil) + # Pass arguments to `get_project_intelligence_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your project. + # + # Format: `projects/{id}/locations/global/intelligenceConfig` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new + # + # # Call the get_project_intelligence_config method. + # result = client.get_project_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def get_project_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest + + # 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_project_intelligence_config.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::Storage::Control::V2::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_project_intelligence_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_project_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :get_project_intelligence_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the Project scoped singleton IntelligenceConfig resource. + # + # @overload update_project_intelligence_config(request, options = nil) + # Pass arguments to `update_project_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_project_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_project_intelligence_config` 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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] + # Required. The `IntelligenceConfig` resource to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @param request_id [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new + # + # # Call the update_project_intelligence_config method. + # result = client.update_project_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def update_project_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_project_intelligence_config.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::Storage::Control::V2::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.intelligence_config&.name + header_params["intelligence_config.name"] = request.intelligence_config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_project_intelligence_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_project_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :update_project_intelligence_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the Folder scoped singleton IntelligenceConfig resource. + # + # @overload get_folder_intelligence_config(request, options = nil) + # Pass arguments to `get_folder_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, ::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_folder_intelligence_config(name: nil) + # Pass arguments to `get_folder_intelligence_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your folder. + # + # Format: `folders/{id}/locations/global/intelligenceConfig` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new + # + # # Call the get_folder_intelligence_config method. + # result = client.get_folder_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def get_folder_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest + + # 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_folder_intelligence_config.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::Storage::Control::V2::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_folder_intelligence_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_folder_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :get_folder_intelligence_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the Folder scoped singleton IntelligenceConfig resource. + # + # @overload update_folder_intelligence_config(request, options = nil) + # Pass arguments to `update_folder_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_folder_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_folder_intelligence_config` 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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] + # Required. The `IntelligenceConfig` resource to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @param request_id [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new + # + # # Call the update_folder_intelligence_config method. + # result = client.update_folder_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def update_folder_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_folder_intelligence_config.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::Storage::Control::V2::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.intelligence_config&.name + header_params["intelligence_config.name"] = request.intelligence_config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_folder_intelligence_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_folder_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :update_folder_intelligence_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the Organization scoped singleton IntelligenceConfig resource. + # + # @overload get_organization_intelligence_config(request, options = nil) + # Pass arguments to `get_organization_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, ::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_organization_intelligence_config(name: nil) + # Pass arguments to `get_organization_intelligence_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your organization. + # + # Format: `organizations/{org_id}/locations/global/intelligenceConfig` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new + # + # # Call the get_organization_intelligence_config method. + # result = client.get_organization_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def get_organization_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest + + # 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_organization_intelligence_config.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::Storage::Control::V2::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_organization_intelligence_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_organization_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :get_organization_intelligence_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the Organization scoped singleton IntelligenceConfig resource. + # + # @overload update_organization_intelligence_config(request, options = nil) + # Pass arguments to `update_organization_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_organization_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_organization_intelligence_config` 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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] + # Required. The `IntelligenceConfig` resource to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @param request_id [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new + # + # # Call the update_organization_intelligence_config method. + # result = client.update_organization_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def update_organization_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_organization_intelligence_config.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::Storage::Control::V2::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.intelligence_config&.name + header_params["intelligence_config.name"] = request.intelligence_config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_organization_intelligence_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_organization_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :update_organization_intelligence_config, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the IAM policy for a specified bucket. + # The `resource` field in the request should be + # `projects/_/buckets/{bucket}` for a bucket, or + # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + # for a managed folder. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::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::Storage::Control::V2::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 && !request.resource.empty? + header_params["bucket"] = request.resource + end + if request.resource + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.resource + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + 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 + + @storage_control_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an IAM policy for the specified bucket. + # The `resource` field in the request should be + # `projects/_/buckets/{bucket}` for a bucket, or + # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + # for a managed folder. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::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::Storage::Control::V2::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 && !request.resource.empty? + header_params["bucket"] = request.resource + end + if request.resource + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.resource + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + 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 + + @storage_control_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Tests a set of permissions on the given bucket, object, or managed folder + # to see which, if any, are held by the caller. + # The `resource` field in the request should be + # `projects/_/buckets/{bucket}` for a bucket, + # `projects/_/buckets/{bucket}/objects/{object}` for an object, or + # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + # for a managed folder. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::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::Storage::Control::V2::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 && !request.resource.empty? + header_params["bucket"] = request.resource + end + if request.resource + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)/objects(?:/.*)?$}.match request.resource + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + if request.resource + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)/managedFolders(?:/.*)?$}.match request.resource + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + 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 + + @storage_control_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the StorageControl API. + # + # This class represents the configuration for StorageControl, + # 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::Storage::Control::V2::StorageControl::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_folder to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Storage::Control::V2::StorageControl::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_folder.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_folder.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "storage.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the StorageControl 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_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :create_folder + ## + # RPC-specific configuration for `delete_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_folder + ## + # RPC-specific configuration for `get_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :get_folder + ## + # RPC-specific configuration for `list_folders` + # @return [::Gapic::Config::Method] + # + attr_reader :list_folders + ## + # RPC-specific configuration for `rename_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :rename_folder + ## + # RPC-specific configuration for `delete_folder_recursive` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_folder_recursive + ## + # RPC-specific configuration for `get_storage_layout` + # @return [::Gapic::Config::Method] + # + attr_reader :get_storage_layout + ## + # RPC-specific configuration for `create_managed_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :create_managed_folder + ## + # RPC-specific configuration for `delete_managed_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_managed_folder + ## + # RPC-specific configuration for `get_managed_folder` + # @return [::Gapic::Config::Method] + # + attr_reader :get_managed_folder + ## + # RPC-specific configuration for `list_managed_folders` + # @return [::Gapic::Config::Method] + # + attr_reader :list_managed_folders + ## + # RPC-specific configuration for `create_anywhere_cache` + # @return [::Gapic::Config::Method] + # + attr_reader :create_anywhere_cache + ## + # RPC-specific configuration for `update_anywhere_cache` + # @return [::Gapic::Config::Method] + # + attr_reader :update_anywhere_cache + ## + # RPC-specific configuration for `disable_anywhere_cache` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_anywhere_cache + ## + # RPC-specific configuration for `pause_anywhere_cache` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_anywhere_cache + ## + # RPC-specific configuration for `resume_anywhere_cache` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_anywhere_cache + ## + # RPC-specific configuration for `get_anywhere_cache` + # @return [::Gapic::Config::Method] + # + attr_reader :get_anywhere_cache + ## + # RPC-specific configuration for `list_anywhere_caches` + # @return [::Gapic::Config::Method] + # + attr_reader :list_anywhere_caches + ## + # RPC-specific configuration for `get_project_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_project_intelligence_config + ## + # RPC-specific configuration for `update_project_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_project_intelligence_config + ## + # RPC-specific configuration for `get_folder_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_folder_intelligence_config + ## + # RPC-specific configuration for `update_folder_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_folder_intelligence_config + ## + # RPC-specific configuration for `get_organization_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_organization_intelligence_config + ## + # RPC-specific configuration for `update_organization_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_organization_intelligence_config + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + create_folder_config = parent_rpcs.create_folder if parent_rpcs.respond_to? :create_folder + @create_folder = ::Gapic::Config::Method.new create_folder_config + delete_folder_config = parent_rpcs.delete_folder if parent_rpcs.respond_to? :delete_folder + @delete_folder = ::Gapic::Config::Method.new delete_folder_config + get_folder_config = parent_rpcs.get_folder if parent_rpcs.respond_to? :get_folder + @get_folder = ::Gapic::Config::Method.new get_folder_config + list_folders_config = parent_rpcs.list_folders if parent_rpcs.respond_to? :list_folders + @list_folders = ::Gapic::Config::Method.new list_folders_config + rename_folder_config = parent_rpcs.rename_folder if parent_rpcs.respond_to? :rename_folder + @rename_folder = ::Gapic::Config::Method.new rename_folder_config + delete_folder_recursive_config = parent_rpcs.delete_folder_recursive if parent_rpcs.respond_to? :delete_folder_recursive + @delete_folder_recursive = ::Gapic::Config::Method.new delete_folder_recursive_config + get_storage_layout_config = parent_rpcs.get_storage_layout if parent_rpcs.respond_to? :get_storage_layout + @get_storage_layout = ::Gapic::Config::Method.new get_storage_layout_config + create_managed_folder_config = parent_rpcs.create_managed_folder if parent_rpcs.respond_to? :create_managed_folder + @create_managed_folder = ::Gapic::Config::Method.new create_managed_folder_config + delete_managed_folder_config = parent_rpcs.delete_managed_folder if parent_rpcs.respond_to? :delete_managed_folder + @delete_managed_folder = ::Gapic::Config::Method.new delete_managed_folder_config + get_managed_folder_config = parent_rpcs.get_managed_folder if parent_rpcs.respond_to? :get_managed_folder + @get_managed_folder = ::Gapic::Config::Method.new get_managed_folder_config + list_managed_folders_config = parent_rpcs.list_managed_folders if parent_rpcs.respond_to? :list_managed_folders + @list_managed_folders = ::Gapic::Config::Method.new list_managed_folders_config + create_anywhere_cache_config = parent_rpcs.create_anywhere_cache if parent_rpcs.respond_to? :create_anywhere_cache + @create_anywhere_cache = ::Gapic::Config::Method.new create_anywhere_cache_config + update_anywhere_cache_config = parent_rpcs.update_anywhere_cache if parent_rpcs.respond_to? :update_anywhere_cache + @update_anywhere_cache = ::Gapic::Config::Method.new update_anywhere_cache_config + disable_anywhere_cache_config = parent_rpcs.disable_anywhere_cache if parent_rpcs.respond_to? :disable_anywhere_cache + @disable_anywhere_cache = ::Gapic::Config::Method.new disable_anywhere_cache_config + pause_anywhere_cache_config = parent_rpcs.pause_anywhere_cache if parent_rpcs.respond_to? :pause_anywhere_cache + @pause_anywhere_cache = ::Gapic::Config::Method.new pause_anywhere_cache_config + resume_anywhere_cache_config = parent_rpcs.resume_anywhere_cache if parent_rpcs.respond_to? :resume_anywhere_cache + @resume_anywhere_cache = ::Gapic::Config::Method.new resume_anywhere_cache_config + get_anywhere_cache_config = parent_rpcs.get_anywhere_cache if parent_rpcs.respond_to? :get_anywhere_cache + @get_anywhere_cache = ::Gapic::Config::Method.new get_anywhere_cache_config + list_anywhere_caches_config = parent_rpcs.list_anywhere_caches if parent_rpcs.respond_to? :list_anywhere_caches + @list_anywhere_caches = ::Gapic::Config::Method.new list_anywhere_caches_config + get_project_intelligence_config_config = parent_rpcs.get_project_intelligence_config if parent_rpcs.respond_to? :get_project_intelligence_config + @get_project_intelligence_config = ::Gapic::Config::Method.new get_project_intelligence_config_config + update_project_intelligence_config_config = parent_rpcs.update_project_intelligence_config if parent_rpcs.respond_to? :update_project_intelligence_config + @update_project_intelligence_config = ::Gapic::Config::Method.new update_project_intelligence_config_config + get_folder_intelligence_config_config = parent_rpcs.get_folder_intelligence_config if parent_rpcs.respond_to? :get_folder_intelligence_config + @get_folder_intelligence_config = ::Gapic::Config::Method.new get_folder_intelligence_config_config + update_folder_intelligence_config_config = parent_rpcs.update_folder_intelligence_config if parent_rpcs.respond_to? :update_folder_intelligence_config + @update_folder_intelligence_config = ::Gapic::Config::Method.new update_folder_intelligence_config_config + get_organization_intelligence_config_config = parent_rpcs.get_organization_intelligence_config if parent_rpcs.respond_to? :get_organization_intelligence_config + @get_organization_intelligence_config = ::Gapic::Config::Method.new get_organization_intelligence_config_config + update_organization_intelligence_config_config = parent_rpcs.update_organization_intelligence_config if parent_rpcs.respond_to? :update_organization_intelligence_config + @update_organization_intelligence_config = ::Gapic::Config::Method.new update_organization_intelligence_config_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/credentials.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/credentials.rb new file mode 100644 index 000000000000..c65981e2f69b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/credentials.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Storage + module Control + module V2 + module StorageControl + # Credentials for the StorageControl API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + 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 +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/operations.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/operations.rb new file mode 100644 index 000000000000..3ba9c91b393a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/operations.rb @@ -0,0 +1,843 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Storage + module Control + module V2 + module StorageControl + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storage.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the StorageControl 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 StorageControl 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`. + # + # @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, return_partial_success: 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. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @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::Storage::Control::V2::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? + throw :response, 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::Storage::Control::V2::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? + throw :response, 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::Storage::Control::V2::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? + 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::Storage::Control::V2::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? + 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::Storage::Control::V2::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? + throw :response, 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: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "storage.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the 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 +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/paths.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/paths.rb new file mode 100644 index 000000000000..669b90f12a51 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/paths.rb @@ -0,0 +1,178 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Storage + module Control + module V2 + module StorageControl + # Path helper methods for the StorageControl API. + module Paths + ## + # Create a fully-qualified AnywhereCache resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # + # @param project [String] + # @param bucket [String] + # @param anywhere_cache [String] + # + # @return [::String] + def anywhere_cache_path project:, bucket:, anywhere_cache: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" + + "projects/#{project}/buckets/#{bucket}/anywhereCaches/#{anywhere_cache}" + end + + ## + # Create a fully-qualified Bucket resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/buckets/{bucket}` + # + # @param project [String] + # @param bucket [String] + # + # @return [::String] + def bucket_path project:, bucket: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/buckets/#{bucket}" + end + + ## + # Create a fully-qualified Folder resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/buckets/{bucket}/folders/{folder=**}` + # + # @param project [String] + # @param bucket [String] + # @param folder [String] + # + # @return [::String] + def folder_path project:, bucket:, folder: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" + + "projects/#{project}/buckets/#{bucket}/folders/#{folder}" + end + + ## + # Create a fully-qualified IntelligenceConfig resource string. + # + # @overload intelligence_config_path(folder:, location:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/intelligenceConfig` + # + # @param folder [String] + # @param location [String] + # + # @overload intelligence_config_path(org:, location:) + # The resource will be in the following format: + # + # `organizations/{org}/locations/{location}/intelligenceConfig` + # + # @param org [String] + # @param location [String] + # + # @overload intelligence_config_path(project:, location:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/intelligenceConfig` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def intelligence_config_path **args + resources = { + "folder:location" => (proc do |folder:, location:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/intelligenceConfig" + end), + "location:org" => (proc do |org:, location:| + raise ::ArgumentError, "org cannot contain /" if org.to_s.include? "/" + + "organizations/#{org}/locations/#{location}/intelligenceConfig" + end), + "location:project" => (proc do |project:, location:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/intelligenceConfig" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + ## + # Create a fully-qualified ManagedFolder resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}` + # + # @param project [String] + # @param bucket [String] + # @param managed_folder [String] + # + # @return [::String] + def managed_folder_path project:, bucket:, managed_folder: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" + + "projects/#{project}/buckets/#{bucket}/managedFolders/#{managed_folder}" + end + + ## + # Create a fully-qualified StorageLayout resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/buckets/{bucket}/storageLayout` + # + # @param project [String] + # @param bucket [String] + # + # @return [::String] + def storage_layout_path project:, bucket: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/buckets/#{bucket}/storageLayout" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest.rb new file mode 100644 index 000000000000..afbdecc7fabf --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/storage/control/v2/version" + +require "google/cloud/storage/control/v2/storage_control/credentials" +require "google/cloud/storage/control/v2/storage_control/paths" +require "google/cloud/storage/control/v2/storage_control/rest/client" + +module Google + module Cloud + module Storage + module Control + module V2 + ## + # StorageControl service includes selected control plane operations. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/storage/control/v2/storage_control/rest" + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + module StorageControl + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/storage/control/v2/storage_control/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/client.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/client.rb new file mode 100644 index 000000000000..b1c5439c8bfa --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/client.rb @@ -0,0 +1,913 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/storage/control/v2/storage_control_pb" +require "google/cloud/storage/control/v2/storage_control/rest/service_stub" + +module Google + module Cloud + module Storage + module Control + module V2 + module StorageControl + module Rest + ## + # REST client for the StorageControl service. + # + # StorageControl service includes selected control plane operations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "storage.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :storage_control_stub + + ## + # Configure the StorageControl Client class. + # + # See {::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all StorageControl clients + # ::Google::Cloud::Storage::Control::V2::StorageControl::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", "Storage", "Control", "V2"] + 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.timeout = 60.0 + + default_config.rpcs.get_project_intelligence_config.timeout = 60.0 + default_config.rpcs.get_project_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.update_project_intelligence_config.timeout = 60.0 + default_config.rpcs.update_project_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_folder_intelligence_config.timeout = 60.0 + default_config.rpcs.get_folder_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.update_folder_intelligence_config.timeout = 60.0 + default_config.rpcs.update_folder_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.get_organization_intelligence_config.timeout = 60.0 + default_config.rpcs.get_organization_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config.rpcs.update_organization_intelligence_config.timeout = 60.0 + default_config.rpcs.update_organization_intelligence_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the StorageControl 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::Storage::Control::V2::StorageControl::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 + @storage_control_stub.universe_domain + end + + ## + # Create a new StorageControl REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the StorageControl 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 + + @storage_control_stub = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @storage_control_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @storage_control_stub.logger + end + + # Service calls + + ## + # Returns the Project scoped singleton IntelligenceConfig resource. + # + # @overload get_project_intelligence_config(request, options = nil) + # Pass arguments to `get_project_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, ::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_project_intelligence_config(name: nil) + # Pass arguments to `get_project_intelligence_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your project. + # + # Format: `projects/{id}/locations/global/intelligenceConfig` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new + # + # # Call the get_project_intelligence_config method. + # result = client.get_project_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def get_project_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest + + # 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_project_intelligence_config.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::Storage::Control::V2::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_project_intelligence_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_project_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.get_project_intelligence_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the Project scoped singleton IntelligenceConfig resource. + # + # @overload update_project_intelligence_config(request, options = nil) + # Pass arguments to `update_project_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_project_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_project_intelligence_config` 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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] + # Required. The `IntelligenceConfig` resource to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @param request_id [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new + # + # # Call the update_project_intelligence_config method. + # result = client.update_project_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def update_project_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_project_intelligence_config.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::Storage::Control::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_project_intelligence_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_project_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.update_project_intelligence_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the Folder scoped singleton IntelligenceConfig resource. + # + # @overload get_folder_intelligence_config(request, options = nil) + # Pass arguments to `get_folder_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, ::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_folder_intelligence_config(name: nil) + # Pass arguments to `get_folder_intelligence_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your folder. + # + # Format: `folders/{id}/locations/global/intelligenceConfig` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new + # + # # Call the get_folder_intelligence_config method. + # result = client.get_folder_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def get_folder_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest + + # 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_folder_intelligence_config.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::Storage::Control::V2::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_folder_intelligence_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_folder_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.get_folder_intelligence_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the Folder scoped singleton IntelligenceConfig resource. + # + # @overload update_folder_intelligence_config(request, options = nil) + # Pass arguments to `update_folder_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_folder_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_folder_intelligence_config` 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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] + # Required. The `IntelligenceConfig` resource to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @param request_id [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new + # + # # Call the update_folder_intelligence_config method. + # result = client.update_folder_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def update_folder_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_folder_intelligence_config.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::Storage::Control::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_folder_intelligence_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_folder_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.update_folder_intelligence_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the Organization scoped singleton IntelligenceConfig resource. + # + # @overload get_organization_intelligence_config(request, options = nil) + # Pass arguments to `get_organization_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, ::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_organization_intelligence_config(name: nil) + # Pass arguments to `get_organization_intelligence_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your organization. + # + # Format: `organizations/{org_id}/locations/global/intelligenceConfig` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new + # + # # Call the get_organization_intelligence_config method. + # result = client.get_organization_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def get_organization_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest + + # 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_organization_intelligence_config.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::Storage::Control::V2::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_organization_intelligence_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_organization_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.get_organization_intelligence_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates the Organization scoped singleton IntelligenceConfig resource. + # + # @overload update_organization_intelligence_config(request, options = nil) + # Pass arguments to `update_organization_intelligence_config` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload update_organization_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_organization_intelligence_config` 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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] + # Required. The `IntelligenceConfig` resource to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @param request_id [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new + # + # # Call the update_organization_intelligence_config method. + # result = client.update_organization_intelligence_config request + # + # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + # p result + # + def update_organization_intelligence_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.update_organization_intelligence_config.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::Storage::Control::V2::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_organization_intelligence_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_organization_intelligence_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.update_organization_intelligence_config request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the StorageControl REST API. + # + # This class represents the configuration for StorageControl 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::Storage::Control::V2::StorageControl::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 + # # get_project_intelligence_config to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_project_intelligence_config.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_project_intelligence_config.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "storage.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the StorageControl 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 `get_project_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_project_intelligence_config + ## + # RPC-specific configuration for `update_project_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_project_intelligence_config + ## + # RPC-specific configuration for `get_folder_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_folder_intelligence_config + ## + # RPC-specific configuration for `update_folder_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_folder_intelligence_config + ## + # RPC-specific configuration for `get_organization_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_organization_intelligence_config + ## + # RPC-specific configuration for `update_organization_intelligence_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_organization_intelligence_config + + # @private + def initialize parent_rpcs = nil + get_project_intelligence_config_config = parent_rpcs.get_project_intelligence_config if parent_rpcs.respond_to? :get_project_intelligence_config + @get_project_intelligence_config = ::Gapic::Config::Method.new get_project_intelligence_config_config + update_project_intelligence_config_config = parent_rpcs.update_project_intelligence_config if parent_rpcs.respond_to? :update_project_intelligence_config + @update_project_intelligence_config = ::Gapic::Config::Method.new update_project_intelligence_config_config + get_folder_intelligence_config_config = parent_rpcs.get_folder_intelligence_config if parent_rpcs.respond_to? :get_folder_intelligence_config + @get_folder_intelligence_config = ::Gapic::Config::Method.new get_folder_intelligence_config_config + update_folder_intelligence_config_config = parent_rpcs.update_folder_intelligence_config if parent_rpcs.respond_to? :update_folder_intelligence_config + @update_folder_intelligence_config = ::Gapic::Config::Method.new update_folder_intelligence_config_config + get_organization_intelligence_config_config = parent_rpcs.get_organization_intelligence_config if parent_rpcs.respond_to? :get_organization_intelligence_config + @get_organization_intelligence_config = ::Gapic::Config::Method.new get_organization_intelligence_config_config + update_organization_intelligence_config_config = parent_rpcs.update_organization_intelligence_config if parent_rpcs.respond_to? :update_organization_intelligence_config + @update_organization_intelligence_config = ::Gapic::Config::Method.new update_organization_intelligence_config_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb new file mode 100644 index 000000000000..5c5d5c81ed57 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb @@ -0,0 +1,452 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/storage/control/v2/storage_control_pb" + +module Google + module Cloud + module Storage + module Control + module V2 + module StorageControl + module Rest + ## + # REST service stub for the StorageControl service. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + # + class ServiceStub + # @private + def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials, + numeric_enums: true, + service_name: self.class, + raise_faraday_errors: false, + logger: logger + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @client_stub.universe_domain + end + + ## + # The effective endpoint + # + # @return [String] + # + def endpoint + @client_stub.endpoint + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger stub: false + stub ? @client_stub.stub_logger : @client_stub.logger + end + + ## + # Baseline implementation for the get_project_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest] + # 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::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # A result object deserialized from the server's reply + def get_project_intelligence_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_project_intelligence_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_project_intelligence_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_project_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest] + # 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::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # A result object deserialized from the server's reply + def update_project_intelligence_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_project_intelligence_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_project_intelligence_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_folder_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest] + # 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::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # A result object deserialized from the server's reply + def get_folder_intelligence_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_folder_intelligence_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_folder_intelligence_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_folder_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest] + # 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::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # A result object deserialized from the server's reply + def update_folder_intelligence_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_folder_intelligence_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_folder_intelligence_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the get_organization_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest] + # 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::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # A result object deserialized from the server's reply + def get_organization_intelligence_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_organization_intelligence_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_organization_intelligence_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the update_organization_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest] + # 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::Storage::Control::V2::IntelligenceConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # A result object deserialized from the server's reply + def update_organization_intelligence_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_organization_intelligence_config_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "update_organization_intelligence_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # @private + # + # GRPC transcoding helper method for the get_project_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest] + # 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_project_intelligence_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_project_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_project_intelligence_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{intelligence_config.name}", + body: "intelligence_config", + matches: [ + ["intelligence_config.name", %r{^projects/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_folder_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest] + # 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_folder_intelligence_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_folder_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_folder_intelligence_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{intelligence_config.name}", + body: "intelligence_config", + matches: [ + ["intelligence_config.name", %r{^folders/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_organization_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest] + # 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_organization_intelligence_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_organization_intelligence_config REST call + # + # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_update_organization_intelligence_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v2/{intelligence_config.name}", + body: "intelligence_config", + matches: [ + ["intelligence_config.name", %r{^organizations/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/version.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/version.rb new file mode 100644 index 000000000000..41fdc28eedf0 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/version.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Storage + module Control + module V2 + VERSION = "0.0.1" + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb new file mode 100644 index 000000000000..13efa67f3d74 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb @@ -0,0 +1,107 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/storage/control/v2/storage_control.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/api/routing_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n/google/storage/control/v2/storage_control.proto\x12\x19google.storage.control.v2\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\x18google/api/routing.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"+\n\x11PendingRenameInfo\x12\x16\n\toperation\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\xe2\x02\n\x06\x46older\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0emetageneration\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12N\n\x13pending_rename_info\x18\x07 \x01(\x0b\x32,.google.storage.control.v2.PendingRenameInfoB\x03\xe0\x41\x03:l\xea\x41i\n\x1dstorage.googleapis.com/Folder\x12\x37projects/{project}/buckets/{bucket}/folders/{folder=**}*\x07\x66olders2\x06\x66older\"\xf4\x01\n\x10GetFolderRequest\x12\x33\n\x04name\x18\x06 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xd5\x01\n\x13\x43reateFolderRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dstorage.googleapis.com/Folder\x12\x36\n\x06\x66older\x18\x02 \x01(\x0b\x32!.google.storage.control.v2.FolderB\x03\xe0\x41\x02\x12\x16\n\tfolder_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\trecursive\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xf7\x01\n\x13\x44\x65leteFolderRequest\x12\x33\n\x04name\x18\x06 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x8c\x02\n\x12ListFoldersRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dstorage.googleapis.com/Folder\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06prefix\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tdelimiter\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13lexicographic_start\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11lexicographic_end\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\t \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"b\n\x13ListFoldersResponse\x12\x32\n\x07\x66olders\x18\x01 \x03(\x0b\x32!.google.storage.control.v2.Folder\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9b\x02\n\x13RenameFolderRequest\x12\x33\n\x04name\x18\x07 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12\"\n\x15\x64\x65stination_folder_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12$\n\x17if_metageneration_match\x18\x04 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x05 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x06 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x8a\x02\n\x1c\x44\x65leteFolderRecursiveRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12)\n\x17if_metageneration_match\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12-\n\x1bif_metageneration_not_match\x18\x03 \x01(\x03\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x9a\x02\n\"CommonLongRunningOperationMetadata\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\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04type\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1d\n\x10progress_percent\x18\x06 \x01(\x05\x42\x03\xe0\x41\x03\"\xa7\x01\n\x14RenameFolderMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x18\n\x10source_folder_id\x18\x02 \x01(\t\x12\x1d\n\x15\x64\x65stination_folder_id\x18\x03 \x01(\t\"\x8a\x01\n\x1d\x44\x65leteFolderRecursiveMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x11\n\tfolder_id\x18\x02 \x01(\t\"\xf8\x03\n\rStorageLayout\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08location\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rlocation_type\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x64\n\x17\x63ustom_placement_config\x18\x04 \x01(\x0b\x32>.google.storage.control.v2.StorageLayout.CustomPlacementConfigB\x03\xe0\x41\x03\x12\x63\n\x16hierarchical_namespace\x18\x05 \x01(\x0b\x32>.google.storage.control.v2.StorageLayout.HierarchicalNamespaceB\x03\xe0\x41\x03\x1a/\n\x15\x43ustomPlacementConfig\x12\x16\n\x0e\x64\x61ta_locations\x18\x01 \x03(\t\x1a(\n\x15HierarchicalNamespace\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08:{\xea\x41x\n$storage.googleapis.com/StorageLayout\x12\x31projects/{project}/buckets/{bucket}/storageLayout*\x0estorageLayouts2\rstorageLayout\"\x86\x01\n\x17GetStorageLayoutRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/StorageLayout\x12\x0e\n\x06prefix\x18\x02 \x01(\t\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xbf\x02\n\rManagedFolder\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0emetageneration\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\x91\x01\xea\x41\x8d\x01\n$storage.googleapis.com/ManagedFolder\x12\x46projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}*\x0emanagedFolders2\rmanagedFolder\"\x82\x02\n\x17GetManagedFolderRequest\x12:\n\x04name\x18\x06 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/ManagedFolder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xe2\x01\n\x1a\x43reateManagedFolderRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/ManagedFolder\x12\x45\n\x0emanaged_folder\x18\x02 \x01(\x0b\x32(.google.storage.control.v2.ManagedFolderB\x03\xe0\x41\x02\x12\x1e\n\x11managed_folder_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x9e\x02\n\x1a\x44\x65leteManagedFolderRequest\x12:\n\x04name\x18\x07 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/ManagedFolder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x17\n\x0f\x61llow_non_empty\x18\x05 \x01(\x08\x12\x1f\n\nrequest_id\x18\x06 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xc0\x01\n\x19ListManagedFoldersRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/ManagedFolder\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06prefix\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x1aListManagedFoldersResponse\x12\x41\n\x0fmanaged_folders\x18\x01 \x03(\x0b\x32(.google.storage.control.v2.ManagedFolder\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb0\x02\n\x1b\x43reateAnywhereCacheMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x1e\n\x11\x61nywhere_cache_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04zone\x18\x06 \x01(\tH\x01\x88\x01\x01\x12+\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x02\x88\x01\x01\x12\x1d\n\x10\x61\x64mission_policy\x18\x05 \x01(\tH\x03\x88\x01\x01\x42\x14\n\x12_anywhere_cache_idB\x07\n\x05_zoneB\x06\n\x04_ttlB\x13\n\x11_admission_policy\"\xb0\x02\n\x1bUpdateAnywhereCacheMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x1e\n\x11\x61nywhere_cache_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04zone\x18\x05 \x01(\tH\x01\x88\x01\x01\x12+\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x02\x88\x01\x01\x12\x1d\n\x10\x61\x64mission_policy\x18\x04 \x01(\tH\x03\x88\x01\x01\x42\x14\n\x12_anywhere_cache_idB\x07\n\x05_zoneB\x06\n\x04_ttlB\x13\n\x11_admission_policy\"\xa5\x03\n\rAnywhereCache\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x11\n\x04zone\x18\n \x01(\tB\x03\xe0\x41\x05\x12&\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x18\n\x10\x61\x64mission_policy\x18\t \x01(\t\x12\x12\n\x05state\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0epending_update\x18\x08 \x01(\x08\x42\x03\xe0\x41\x03:\x8e\x01\xea\x41\x8a\x01\n$storage.googleapis.com/AnywhereCache\x12\x43projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}*\x0e\x61nywhereCaches2\ranywhereCache\"\xc2\x01\n\x1a\x43reateAnywhereCacheRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/AnywhereCache\x12\x45\n\x0e\x61nywhere_cache\x18\x03 \x01(\x0b\x32(.google.storage.control.v2.AnywhereCacheB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xba\x01\n\x1aUpdateAnywhereCacheRequest\x12\x45\n\x0e\x61nywhere_cache\x18\x01 \x01(\x0b\x32(.google.storage.control.v2.AnywhereCacheB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"z\n\x1b\x44isableAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x19PauseAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"y\n\x1aResumeAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"v\n\x17GetAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xa1\x01\n\x19ListAnywhereCachesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/AnywhereCache\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x1aListAnywhereCachesResponse\x12\x41\n\x0f\x61nywhere_caches\x18\x01 \x03(\x0b\x32(.google.storage.control.v2.AnywhereCache\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8e\x0e\n\x12IntelligenceConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12X\n\x0e\x65\x64ition_config\x18\x02 \x01(\x0e\x32;.google.storage.control.v2.IntelligenceConfig.EditionConfigB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12I\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x34.google.storage.control.v2.IntelligenceConfig.FilterB\x03\xe0\x41\x01\x12u\n\x1d\x65\x66\x66\x65\x63tive_intelligence_config\x18\x05 \x01(\x0b\x32I.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfigB\x03\xe0\x41\x03\x12O\n\x0ctrial_config\x18\x07 \x01(\x0b\x32\x39.google.storage.control.v2.IntelligenceConfig.TrialConfig\x1a\xfc\x04\n\x06\x46ilter\x12v\n included_cloud_storage_locations\x18\x01 \x01(\x0b\x32J.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocationsH\x00\x12v\n excluded_cloud_storage_locations\x18\x02 \x01(\x0b\x32J.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocationsH\x00\x12r\n\x1eincluded_cloud_storage_buckets\x18\x03 \x01(\x0b\x32H.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBucketsH\x01\x12r\n\x1e\x65xcluded_cloud_storage_buckets\x18\x04 \x01(\x0b\x32H.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBucketsH\x01\x1a/\n\x15\x43loudStorageLocations\x12\x16\n\tlocations\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a\x35\n\x13\x43loudStorageBuckets\x12\x1e\n\x11\x62ucket_id_regexes\x18\x01 \x03(\tB\x03\xe0\x41\x01\x42\x19\n\x17\x63loud_storage_locationsB\x17\n\x15\x63loud_storage_buckets\x1a\x8a\x02\n\x1b\x45\x66\x66\x65\x63tiveIntelligenceConfig\x12z\n\x11\x65\x66\x66\x65\x63tive_edition\x18\x01 \x01(\x0e\x32Z.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEditionB\x03\xe0\x41\x03\x12 \n\x13intelligence_config\x18\x02 \x01(\tB\x03\xe0\x41\x03\"M\n\x10\x45\x66\x66\x65\x63tiveEdition\x12!\n\x1d\x45\x46\x46\x45\x43TIVE_EDITION_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0c\n\x08STANDARD\x10\x02\x1a\x43\n\x0bTrialConfig\x12\x34\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"c\n\rEditionConfig\x12\x1e\n\x1a\x45\x44ITION_CONFIG_UNSPECIFIED\x10\x00\x12\x0b\n\x07INHERIT\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\x0c\n\x08STANDARD\x10\x03\x12\t\n\x05TRIAL\x10\x05:\x8b\x02\xea\x41\x87\x02\n)storage.googleapis.com/IntelligenceConfig\x12\x38\x66olders/{folder}/locations/{location}/intelligenceConfig\x12;organizations/{org}/locations/{location}/intelligenceConfig\x12:projects/{project}/locations/{location}/intelligenceConfig*\x13intelligenceConfigs2\x12intelligenceConfig\"\xd5\x01\n+UpdateOrganizationIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xcf\x01\n%UpdateFolderIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xd0\x01\n&UpdateProjectIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"k\n(GetOrganizationIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig\"e\n\"GetFolderIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig\"f\n#GetProjectIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig2\xd2,\n\x0eStorageControl\x12\x9a\x01\n\x0c\x43reateFolder\x12..google.storage.control.v2.CreateFolderRequest\x1a!.google.storage.control.v2.Folder\"7\xda\x41\x17parent,folder,folder_id\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\x8f\x01\n\x0c\x44\x65leteFolder\x12..google.storage.control.v2.DeleteFolderRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\x94\x01\n\tGetFolder\x12+.google.storage.control.v2.GetFolderRequest\x1a!.google.storage.control.v2.Folder\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\x94\x01\n\x0bListFolders\x12-.google.storage.control.v2.ListFoldersRequest\x1a..google.storage.control.v2.ListFoldersResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xcd\x01\n\x0cRenameFolder\x12..google.storage.control.v2.RenameFolderRequest\x1a\x1d.google.longrunning.Operation\"n\xca\x41\x1e\n\x06\x46older\x12\x14RenameFolderMetadata\xda\x41\x1aname,destination_folder_id\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xe1\x01\n\x15\x44\x65leteFolderRecursive\x12\x37.google.storage.control.v2.DeleteFolderRecursiveRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x36\n\x15google.protobuf.Empty\x12\x1d\x44\x65leteFolderRecursiveMetadata\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetStorageLayout\x12\x32.google.storage.control.v2.GetStorageLayoutRequest\x1a(.google.storage.control.v2.StorageLayout\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xbf\x01\n\x13\x43reateManagedFolder\x12\x35.google.storage.control.v2.CreateManagedFolderRequest\x1a(.google.storage.control.v2.ManagedFolder\"G\xda\x41\'parent,managed_folder,managed_folder_id\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\x9d\x01\n\x13\x44\x65leteManagedFolder\x12\x35.google.storage.control.v2.DeleteManagedFolderRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetManagedFolder\x12\x32.google.storage.control.v2.GetManagedFolderRequest\x1a(.google.storage.control.v2.ManagedFolder\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x12ListManagedFolders\x12\x34.google.storage.control.v2.ListManagedFoldersRequest\x1a\x35.google.storage.control.v2.ListManagedFoldersResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xd1\x01\n\x13\x43reateAnywhereCache\x12\x35.google.storage.control.v2.CreateAnywhereCacheRequest\x1a\x1d.google.longrunning.Operation\"d\xca\x41,\n\rAnywhereCache\x12\x1b\x43reateAnywhereCacheMetadata\xda\x41\x15parent,anywhere_cache\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xf9\x01\n\x13UpdateAnywhereCache\x12\x35.google.storage.control.v2.UpdateAnywhereCacheRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41,\n\rAnywhereCache\x12\x1bUpdateAnywhereCacheMetadata\xda\x41\x1a\x61nywhere_cache,update_mask\x8a\xd3\xe4\x93\x02\x39\x12\x37\n\x13\x61nywhere_cache.name\x12 {bucket=projects/*/buckets/*}/**\x12\xb1\x01\n\x14\x44isableAnywhereCache\x12\x36.google.storage.control.v2.DisableAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xad\x01\n\x12PauseAnywhereCache\x12\x34.google.storage.control.v2.PauseAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xaf\x01\n\x13ResumeAnywhereCache\x12\x35.google.storage.control.v2.ResumeAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetAnywhereCache\x12\x32.google.storage.control.v2.GetAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x12ListAnywhereCaches\x12\x34.google.storage.control.v2.ListAnywhereCachesRequest\x1a\x35.google.storage.control.v2.ListAnywhereCachesResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xd2\x01\n\x1cGetProjectIntelligenceConfig\x12>.google.storage.control.v2.GetProjectIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v2/{name=projects/*/locations/*/intelligenceConfig}\x12\x9d\x02\n\x1fUpdateProjectIntelligenceConfig\x12\x41.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x87\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02_2H/v2/{intelligence_config.name=projects/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xcf\x01\n\x1bGetFolderIntelligenceConfig\x12=.google.storage.control.v2.GetFolderIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v2/{name=folders/*/locations/*/intelligenceConfig}\x12\x9a\x02\n\x1eUpdateFolderIntelligenceConfig\x12@.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x86\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02^2G/v2/{intelligence_config.name=folders/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xe1\x01\n!GetOrganizationIntelligenceConfig\x12\x43.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v2/{name=organizations/*/locations/*/intelligenceConfig}\x12\xac\x02\n$UpdateOrganizationIntelligenceConfig\x12\x46.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x8c\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02\x64\x32M/v2/{intelligence_config.name=organizations/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xa3\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"X\xda\x41\x08resource\x8a\xd3\xe4\x93\x02G\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12,\n\x08resource\x12 {bucket=projects/*/buckets/*}/**\x12\xaa\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"_\xda\x41\x0fresource,policy\x8a\xd3\xe4\x93\x02G\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12,\n\x08resource\x12 {bucket=projects/*/buckets/*}/**\x12\x96\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\xaa\x01\xda\x41\x14resource,permissions\x8a\xd3\xe4\x93\x02\x8c\x01\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12\x34\n\x08resource\x12({bucket=projects/*/buckets/*}/objects/**\x12;\n\x08resource\x12/{bucket=projects/*/buckets/*}/managedFolders/**\x1a\xa7\x02\xca\x41\x16storage.googleapis.com\xd2\x41\x8a\x02https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/devstorage.full_control,https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/devstorage.read_writeB\xa6\x02\n\x1d\x63om.google.storage.control.v2B\x13StorageControlProtoP\x01Z=cloud.google.com/go/storage/control/apiv2/controlpb;controlpb\xaa\x02\x1fGoogle.Cloud.Storage.Control.V2\xca\x02\x1fGoogle\\Cloud\\Storage\\Control\\V2\xea\x02#Google::Cloud::Storage::Control::V2\xea\x41\x44\n\x1dstorage.googleapis.com/Bucket\x12#projects/{project}/buckets/{bucket}b\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.protobuf.FieldMask", "google/protobuf/field_mask.proto"], + ] + imports.each do |type_name, expected_filename| + import_file = pool.lookup(type_name).file_descriptor + if import_file.name != expected_filename + warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" + end + end + warn "Each proto file must use a consistent fully-qualified name." + warn "This will become an error in the next major version." +end + +module Google + module Cloud + module Storage + module Control + module V2 + PendingRenameInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.PendingRenameInfo").msgclass + Folder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.Folder").msgclass + GetFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetFolderRequest").msgclass + CreateFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CreateFolderRequest").msgclass + DeleteFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteFolderRequest").msgclass + ListFoldersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListFoldersRequest").msgclass + ListFoldersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListFoldersResponse").msgclass + RenameFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.RenameFolderRequest").msgclass + DeleteFolderRecursiveRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteFolderRecursiveRequest").msgclass + CommonLongRunningOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CommonLongRunningOperationMetadata").msgclass + RenameFolderMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.RenameFolderMetadata").msgclass + DeleteFolderRecursiveMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteFolderRecursiveMetadata").msgclass + StorageLayout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.StorageLayout").msgclass + StorageLayout::CustomPlacementConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.StorageLayout.CustomPlacementConfig").msgclass + StorageLayout::HierarchicalNamespace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.StorageLayout.HierarchicalNamespace").msgclass + GetStorageLayoutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetStorageLayoutRequest").msgclass + ManagedFolder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ManagedFolder").msgclass + GetManagedFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetManagedFolderRequest").msgclass + CreateManagedFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CreateManagedFolderRequest").msgclass + DeleteManagedFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteManagedFolderRequest").msgclass + ListManagedFoldersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListManagedFoldersRequest").msgclass + ListManagedFoldersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListManagedFoldersResponse").msgclass + CreateAnywhereCacheMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CreateAnywhereCacheMetadata").msgclass + UpdateAnywhereCacheMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateAnywhereCacheMetadata").msgclass + AnywhereCache = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.AnywhereCache").msgclass + CreateAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CreateAnywhereCacheRequest").msgclass + UpdateAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateAnywhereCacheRequest").msgclass + DisableAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DisableAnywhereCacheRequest").msgclass + PauseAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.PauseAnywhereCacheRequest").msgclass + ResumeAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ResumeAnywhereCacheRequest").msgclass + GetAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetAnywhereCacheRequest").msgclass + ListAnywhereCachesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListAnywhereCachesRequest").msgclass + ListAnywhereCachesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListAnywhereCachesResponse").msgclass + IntelligenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig").msgclass + IntelligenceConfig::Filter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.Filter").msgclass + IntelligenceConfig::Filter::CloudStorageLocations = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations").msgclass + IntelligenceConfig::Filter::CloudStorageBuckets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets").msgclass + IntelligenceConfig::EffectiveIntelligenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig").msgclass + IntelligenceConfig::EffectiveIntelligenceConfig::EffectiveEdition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition").enummodule + IntelligenceConfig::TrialConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.TrialConfig").msgclass + IntelligenceConfig::EditionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.EditionConfig").enummodule + UpdateOrganizationIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest").msgclass + UpdateFolderIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateFolderIntelligenceConfigRequest").msgclass + UpdateProjectIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateProjectIntelligenceConfigRequest").msgclass + GetOrganizationIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetOrganizationIntelligenceConfigRequest").msgclass + GetFolderIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetFolderIntelligenceConfigRequest").msgclass + GetProjectIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetProjectIntelligenceConfigRequest").msgclass + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb new file mode 100644 index 000000000000..e631a002bf14 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb @@ -0,0 +1,125 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/storage/control/v2/storage_control.proto for package 'Google.Cloud.Storage.Control.V2' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# 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/storage/control/v2/storage_control_pb' + +module Google + module Cloud + module Storage + module Control + module V2 + module StorageControl + # StorageControl service includes selected control plane operations. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.storage.control.v2.StorageControl' + + # Creates a new folder. This operation is only applicable to a hierarchical + # namespace enabled bucket. + rpc :CreateFolder, ::Google::Cloud::Storage::Control::V2::CreateFolderRequest, ::Google::Cloud::Storage::Control::V2::Folder + # Permanently deletes an empty folder. This operation is only applicable to a + # hierarchical namespace enabled bucket. + rpc :DeleteFolder, ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest, ::Google::Protobuf::Empty + # Returns metadata for the specified folder. This operation is only + # applicable to a hierarchical namespace enabled bucket. + rpc :GetFolder, ::Google::Cloud::Storage::Control::V2::GetFolderRequest, ::Google::Cloud::Storage::Control::V2::Folder + # Retrieves a list of folders. This operation is only applicable to a + # hierarchical namespace enabled bucket. + rpc :ListFolders, ::Google::Cloud::Storage::Control::V2::ListFoldersRequest, ::Google::Cloud::Storage::Control::V2::ListFoldersResponse + # Renames a source folder to a destination folder. This operation is only + # applicable to a hierarchical namespace enabled bucket. During a rename, the + # source and destination folders are locked until the long running operation + # completes. + rpc :RenameFolder, ::Google::Cloud::Storage::Control::V2::RenameFolderRequest, ::Google::Longrunning::Operation + # Deletes a folder recursively. This operation is only applicable to a + # hierarchical namespace enabled bucket. + rpc :DeleteFolderRecursive, ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest, ::Google::Longrunning::Operation + # Returns the storage layout configuration for a given bucket. + rpc :GetStorageLayout, ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest, ::Google::Cloud::Storage::Control::V2::StorageLayout + # Creates a new managed folder. + rpc :CreateManagedFolder, ::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest, ::Google::Cloud::Storage::Control::V2::ManagedFolder + # Permanently deletes an empty managed folder. + rpc :DeleteManagedFolder, ::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest, ::Google::Protobuf::Empty + # Returns metadata for the specified managed folder. + rpc :GetManagedFolder, ::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest, ::Google::Cloud::Storage::Control::V2::ManagedFolder + # Retrieves a list of managed folders for a given bucket. + rpc :ListManagedFolders, ::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest, ::Google::Cloud::Storage::Control::V2::ListManagedFoldersResponse + # Creates an Anywhere Cache instance. + rpc :CreateAnywhereCache, ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest, ::Google::Longrunning::Operation + # Updates an Anywhere Cache instance. Mutable fields include `ttl` and + # `admission_policy`. + rpc :UpdateAnywhereCache, ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest, ::Google::Longrunning::Operation + # Disables an Anywhere Cache instance. A disabled instance is read-only. The + # disablement could be revoked by calling ResumeAnywhereCache. The cache + # instance will be deleted automatically if it remains in the disabled state + # for at least one hour. + rpc :DisableAnywhereCache, ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest, ::Google::Cloud::Storage::Control::V2::AnywhereCache + # Pauses an Anywhere Cache instance. + rpc :PauseAnywhereCache, ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest, ::Google::Cloud::Storage::Control::V2::AnywhereCache + # Resumes a disabled or paused Anywhere Cache instance. + rpc :ResumeAnywhereCache, ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest, ::Google::Cloud::Storage::Control::V2::AnywhereCache + # Gets an Anywhere Cache instance. + rpc :GetAnywhereCache, ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest, ::Google::Cloud::Storage::Control::V2::AnywhereCache + # Lists Anywhere Cache instances for a given bucket. + rpc :ListAnywhereCaches, ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest, ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesResponse + # Returns the Project scoped singleton IntelligenceConfig resource. + rpc :GetProjectIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig + # Updates the Project scoped singleton IntelligenceConfig resource. + rpc :UpdateProjectIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig + # Returns the Folder scoped singleton IntelligenceConfig resource. + rpc :GetFolderIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig + # Updates the Folder scoped singleton IntelligenceConfig resource. + rpc :UpdateFolderIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig + # Returns the Organization scoped singleton IntelligenceConfig resource. + rpc :GetOrganizationIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig + # Updates the Organization scoped singleton IntelligenceConfig resource. + rpc :UpdateOrganizationIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig + # Gets the IAM policy for a specified bucket. + # The `resource` field in the request should be + # `projects/_/buckets/{bucket}` for a bucket, or + # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + # for a managed folder. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Updates an IAM policy for the specified bucket. + # The `resource` field in the request should be + # `projects/_/buckets/{bucket}` for a bucket, or + # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + # for a managed folder. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Tests a set of permissions on the given bucket, object, or managed folder + # to see which, if any, are held by the caller. + # The `resource` field in the request should be + # `projects/_/buckets/{bucket}` for a bucket, + # `projects/_/buckets/{bucket}/objects/{object}` for an object, or + # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + # for a managed folder. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/README.md new file mode 100644 index 000000000000..1aefe1559ea2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/README.md @@ -0,0 +1,4 @@ +# Storage Control V2 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-storage-control-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..d59ba51a5612 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/client.rb @@ -0,0 +1,473 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. This is the full protobuf + # package for the API, ending in the version element. + # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a *public* URI where users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + # @!attribute [rw] proto_reference_documentation_uri + # @return [::String] + # Optional link to proto reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rpc + # @!attribute [rw] rest_reference_documentation_uri + # @return [::String] + # Optional link to REST reference documentation. Example: + # https://cloud.google.com/pubsub/lite/docs/reference/rest + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] experimental_features + # @return [::Google::Api::PythonSettings::ExperimentalFeatures] + # Experimental features to be included during client library generation. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Experimental features to be included during client library generation. + # These fields will be deprecated once the feature graduates and is enabled + # by default. + # @!attribute [rw] rest_async_io_enabled + # @return [::Boolean] + # Enables generation of asynchronous REST clients if `rest` transport is + # enabled. By default, asynchronous REST clients will not be generated. + # This feature will be enabled by default 1 month after launching the + # feature in preview packages. + # @!attribute [rw] protobuf_pythonic_types_enabled + # @return [::Boolean] + # Enables generation of protobuf code using new types that are more + # Pythonic which are included in `protobuf>=5.29.x`. This feature will be + # enabled by default 1 month after launching the feature in preview + # packages. + # @!attribute [rw] unversioned_package_disabled + # @return [::Boolean] + # Disables generation of an unversioned Python package for this client + # library. This means that the module names will need to be versioned in + # import statements. For example `import google.cloud.library_v2` instead + # of `import google.cloud.library`. + class ExperimentalFeatures + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from original service names to renamed versions. + # This is used when the default generated types + # would cause a naming conflict. (Neither name is + # fully-qualified.) + # Example: Subscriber to SubscriberServiceApi. + # @!attribute [rw] renamed_resources + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from full resource types to the effective short name + # for the resource. This is used when otherwise resource + # named from different services would cause naming collisions. + # Example entry: + # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + # @!attribute [rw] ignored_resources + # @return [::Array<::String>] + # List of full resource types to ignore during generation. + # This is typically used for API-specific Location resources, + # which should be handled by the generator as if they were actually + # the common Location resources. + # Example entry: "documentai.googleapis.com/Location" + # @!attribute [rw] forced_namespace_aliases + # @return [::Array<::String>] + # Namespaces which must be aliased in snippets due to + # a known (but non-generator-predictable) naming collision + # @!attribute [rw] handwritten_signatures + # @return [::Array<::String>] + # Method signatures (in the form "service.method(signature)") + # which are provided separately, so shouldn't be generated. + # Snippets *calling* these methods are still generated, however. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedResourcesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + # @!attribute [rw] renamed_services + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of service names to renamed services. Keys are the package relative + # service names and values are the name to be used for the service client + # and call options. + # + # publishing: + # go_settings: + # renamed_services: + # Publisher: TopicAdmin + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class RenamedServicesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # + # Example: + # + # publishing: + # method_settings: + # - selector: google.storage.control.v2.StorageControl.CreateFolder + # # method settings for CreateFolder... + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_settings: + # - selector: google.cloud.speech.v2.Speech.BatchRecognize + # long_running: + # initial_poll_delay: 60s # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: 360s # 6 minutes + # total_poll_timeout: 54000s # 90 minutes + # @!attribute [rw] auto_populated_fields + # @return [::Array<::String>] + # List of top-level fields of the request message, that should be + # automatically populated by the client libraries based on their + # (google.api.field_info).format. Currently supported format: UUID4. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.CreateExample + # auto_populated_fields: + # - request_id + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # This message is used to configure the generation of a subset of the RPCs in + # a service for client libraries. + # @!attribute [rw] methods + # @return [::Array<::String>] + # An allowlist of the fully qualified names of RPCs that should be included + # on public client surfaces. + # @!attribute [rw] generate_omitted_as_internal + # @return [::Boolean] + # Setting this to true indicates to the client generators that methods + # that would be excluded from the generation should instead be generated + # in a way that indicates these methods should not be consumed by + # end users. How this is expressed is up to individual language + # implementations to decide. Some examples may be: added annotations, + # obfuscated identifiers, or other language idiomatic patterns. + class SelectiveGapicGeneration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + + # Shopping Org. + SHOPPING = 5 + + # Geo Org. + GEO = 6 + + # Generative AI - https://developers.generativeai.google + GENERATIVE_AI = 7 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_behavior.rb @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module 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-storage-control-v2/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_info.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module 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-storage-control-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module 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-storage-control-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/resource.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module 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-storage-control-v2/proto_docs/google/api/routing.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/routing.rb new file mode 100644 index 000000000000..d777329024e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/routing.rb @@ -0,0 +1,459 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Specifies the routing information that should be sent along with the request + # in the form of routing header. + # **NOTE:** All service configuration rules follow the "last one wins" order. + # + # The examples below will apply to an RPC which has the following request type: + # + # Message Definition: + # + # message Request { + # // The name of the Table + # // Values can be of the following formats: + # // - `projects//tables/` + # // - `projects//instances//tables/
` + # // - `region//zones//tables/
` + # string table_name = 1; + # + # // This value specifies routing for replication. + # // It can be in the following formats: + # // - `profiles/` + # // - a legacy `profile_id` that can be any string + # string app_profile_id = 2; + # } + # + # Example message: + # + # { + # table_name: projects/proj_foo/instances/instance_bar/table/table_baz, + # app_profile_id: profiles/prof_qux + # } + # + # The routing header consists of one or multiple key-value pairs. Every key + # and value must be percent-encoded, and joined together in the format of + # `key1=value1&key2=value2`. + # The examples below skip the percent-encoding for readability. + # + # Example 1 + # + # Extracting a field from the request to put into the routing header + # unchanged, with the key equal to the field name. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `app_profile_id`. + # routing_parameters { + # field: "app_profile_id" + # } + # }; + # + # result: + # + # x-goog-request-params: app_profile_id=profiles/prof_qux + # + # Example 2 + # + # Extracting a field from the request to put into the routing header + # unchanged, with the key different from the field name. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `app_profile_id`, but name it `routing_id` in the header. + # routing_parameters { + # field: "app_profile_id" + # path_template: "{routing_id=**}" + # } + # }; + # + # result: + # + # x-goog-request-params: routing_id=profiles/prof_qux + # + # Example 3 + # + # Extracting a field from the request to put into the routing + # header, while matching a path template syntax on the field's value. + # + # NB: it is more useful to send nothing than to send garbage for the purpose + # of dynamic routing, since garbage pollutes cache. Thus the matching. + # + # Sub-example 3a + # + # The field matches the template. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `table_name`, if it's well-formed (with project-based + # // syntax). + # routing_parameters { + # field: "table_name" + # path_template: "{table_name=projects/*/instances/*/**}" + # } + # }; + # + # result: + # + # x-goog-request-params: + # table_name=projects/proj_foo/instances/instance_bar/table/table_baz + # + # Sub-example 3b + # + # The field does not match the template. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `table_name`, if it's well-formed (with region-based + # // syntax). + # routing_parameters { + # field: "table_name" + # path_template: "{table_name=regions/*/zones/*/**}" + # } + # }; + # + # result: + # + # + # + # Sub-example 3c + # + # Multiple alternative conflictingly named path templates are + # specified. The one that matches is used to construct the header. + # + # annotation: + # + # option (google.api.routing) = { + # // Take the `table_name`, if it's well-formed, whether + # // using the region- or projects-based syntax. + # + # routing_parameters { + # field: "table_name" + # path_template: "{table_name=regions/*/zones/*/**}" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{table_name=projects/*/instances/*/**}" + # } + # }; + # + # result: + # + # x-goog-request-params: + # table_name=projects/proj_foo/instances/instance_bar/table/table_baz + # + # Example 4 + # + # Extracting a single routing header key-value pair by matching a + # template syntax on (a part of) a single request field. + # + # annotation: + # + # option (google.api.routing) = { + # // Take just the project id from the `table_name` field. + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*}/**" + # } + # }; + # + # result: + # + # x-goog-request-params: routing_id=projects/proj_foo + # + # Example 5 + # + # Extracting a single routing header key-value pair by matching + # several conflictingly named path templates on (parts of) a single request + # field. The last template to match "wins" the conflict. + # + # annotation: + # + # option (google.api.routing) = { + # // If the `table_name` does not have instances information, + # // take just the project id for routing. + # // Otherwise take project + instance. + # + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*}/**" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*/instances/*}/**" + # } + # }; + # + # result: + # + # x-goog-request-params: + # routing_id=projects/proj_foo/instances/instance_bar + # + # Example 6 + # + # Extracting multiple routing header key-value pairs by matching + # several non-conflicting path templates on (parts of) a single request field. + # + # Sub-example 6a + # + # Make the templates strict, so that if the `table_name` does not + # have an instance information, nothing is sent. + # + # annotation: + # + # option (google.api.routing) = { + # // The routing code needs two keys instead of one composite + # // but works only for the tables with the "project-instance" name + # // syntax. + # + # routing_parameters { + # field: "table_name" + # path_template: "{project_id=projects/*}/instances/*/**" + # } + # routing_parameters { + # field: "table_name" + # path_template: "projects/*/{instance_id=instances/*}/**" + # } + # }; + # + # result: + # + # x-goog-request-params: + # project_id=projects/proj_foo&instance_id=instances/instance_bar + # + # Sub-example 6b + # + # Make the templates loose, so that if the `table_name` does not + # have an instance information, just the project id part is sent. + # + # annotation: + # + # option (google.api.routing) = { + # // The routing code wants two keys instead of one composite + # // but will work with just the `project_id` for tables without + # // an instance in the `table_name`. + # + # routing_parameters { + # field: "table_name" + # path_template: "{project_id=projects/*}/**" + # } + # routing_parameters { + # field: "table_name" + # path_template: "projects/*/{instance_id=instances/*}/**" + # } + # }; + # + # result (is the same as 6a for our example message because it has the instance + # information): + # + # x-goog-request-params: + # project_id=projects/proj_foo&instance_id=instances/instance_bar + # + # Example 7 + # + # Extracting multiple routing header key-value pairs by matching + # several path templates on multiple request fields. + # + # NB: note that here there is no way to specify sending nothing if one of the + # fields does not match its template. E.g. if the `table_name` is in the wrong + # format, the `project_id` will not be sent, but the `routing_id` will be. + # The backend routing code has to be aware of that and be prepared to not + # receive a full complement of keys if it expects multiple. + # + # annotation: + # + # option (google.api.routing) = { + # // The routing needs both `project_id` and `routing_id` + # // (from the `app_profile_id` field) for routing. + # + # routing_parameters { + # field: "table_name" + # path_template: "{project_id=projects/*}/**" + # } + # routing_parameters { + # field: "app_profile_id" + # path_template: "{routing_id=**}" + # } + # }; + # + # result: + # + # x-goog-request-params: + # project_id=projects/proj_foo&routing_id=profiles/prof_qux + # + # Example 8 + # + # Extracting a single routing header key-value pair by matching + # several conflictingly named path templates on several request fields. The + # last template to match "wins" the conflict. + # + # annotation: + # + # option (google.api.routing) = { + # // The `routing_id` can be a project id or a region id depending on + # // the table name format, but only if the `app_profile_id` is not set. + # // If `app_profile_id` is set it should be used instead. + # + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*}/**" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=regions/*}/**" + # } + # routing_parameters { + # field: "app_profile_id" + # path_template: "{routing_id=**}" + # } + # }; + # + # result: + # + # x-goog-request-params: routing_id=profiles/prof_qux + # + # Example 9 + # + # Bringing it all together. + # + # annotation: + # + # option (google.api.routing) = { + # // For routing both `table_location` and a `routing_id` are needed. + # // + # // table_location can be either an instance id or a region+zone id. + # // + # // For `routing_id`, take the value of `app_profile_id` + # // - If it's in the format `profiles/`, send + # // just the `` part. + # // - If it's any other literal, send it as is. + # // If the `app_profile_id` is empty, and the `table_name` starts with + # // the project_id, send that instead. + # + # routing_parameters { + # field: "table_name" + # path_template: "projects/*/{table_location=instances/*}/tables/*" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{table_location=regions/*/zones/*}/tables/*" + # } + # routing_parameters { + # field: "table_name" + # path_template: "{routing_id=projects/*}/**" + # } + # routing_parameters { + # field: "app_profile_id" + # path_template: "{routing_id=**}" + # } + # routing_parameters { + # field: "app_profile_id" + # path_template: "profiles/{routing_id=*}" + # } + # }; + # + # result: + # + # x-goog-request-params: + # table_location=instances/instance_bar&routing_id=prof_qux + # @!attribute [rw] routing_parameters + # @return [::Array<::Google::Api::RoutingParameter>] + # A collection of Routing Parameter specifications. + # **NOTE:** If multiple Routing Parameters describe the same key + # (via the `path_template` field or via the `field` field when + # `path_template` is not provided), "last one wins" rule + # determines which Parameter gets used. + # See the examples for more details. + class RoutingRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A projection from an input message to the GRPC or REST header. + # @!attribute [rw] field + # @return [::String] + # A request field to extract the header key-value pair from. + # @!attribute [rw] path_template + # @return [::String] + # A pattern matching the key-value field. Optional. + # If not specified, the whole field specified in the `field` field will be + # taken as value, and its name used as key. If specified, it MUST contain + # exactly one named segment (along with any number of unnamed segments) The + # pattern will be matched over the field specified in the `field` field, then + # if the match is successful: + # - the name of the single named segment will be used as a header name, + # - the match value of the segment will be used as a header value; + # if the match is NOT successful, nothing will be sent. + # + # Example: + # + # -- This is a field in the request message + # | that the header value will be extracted from. + # | + # | -- This is the key name in the + # | | routing header. + # V | + # field: "table_name" v + # path_template: "projects/*/{table_location=instances/*}/tables/*" + # ^ ^ + # | | + # In the {} brackets is the pattern that -- | + # specifies what to extract from the | + # field as a value to be sent. | + # | + # The string in the field must match the whole pattern -- + # before brackets, inside brackets, after brackets. + # + # When looking at this specific example, we can see that: + # - A key-value pair with the key `table_location` + # and the value matching `instances/*` should be added + # to the x-goog-request-params routing header. + # - The value is extracted from the request message's `table_name` field + # if it matches the full pattern specified: + # `projects/*/instances/*/tables/*`. + # + # **NB:** If the `path_template` field is not provided, the key name is + # equal to the field name, and the whole field should be sent as a value. + # This makes the pattern for the field and the value functionally equivalent + # to `**`, and the configuration + # + # { + # field: "table_name" + # } + # + # is a functionally equivalent shorthand to: + # + # { + # field: "table_name" + # path_template: "{table_name=**}" + # } + # + # See Example 1 for more details. + class RoutingParameter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module 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-storage-control-v2/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module 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-storage-control-v2/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module 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. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. 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`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + 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. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + 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. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + 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 Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!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-storage-control-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/any.rb @@ -0,0 +1,145 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module 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-storage-control-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module 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-storage-control-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/empty.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module 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-storage-control-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module 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-storage-control-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/timestamp.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module 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-storage-control-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/rpc/status.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module 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-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb new file mode 100644 index 000000000000..6ab7a9a20ea8 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb @@ -0,0 +1,1026 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Storage + module Control + module V2 + # Contains information about a pending rename operation. + # @!attribute [r] operation + # @return [::String] + # Output only. The name of the rename operation. + class PendingRenameInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A folder resource. This resource can only exist in a hierarchical namespace + # enabled bucket. + # @!attribute [rw] name + # @return [::String] + # Identifier. The name of this folder. + # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + # @!attribute [r] metageneration + # @return [::Integer] + # Output only. The version of the metadata for this folder. Used for + # preconditions and for detecting changes in metadata. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation time of the folder. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The modification time of the folder. + # @!attribute [r] pending_rename_info + # @return [::Google::Cloud::Storage::Control::V2::PendingRenameInfo] + # Output only. Only present if the folder is part of an ongoing RenameFolder + # operation. Contains information which can be used to query the operation + # status. The presence of this field also indicates all write operations are + # blocked for this folder, including folder, managed folder, and object + # operations. + class Folder + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetFolder. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the folder. + # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + # @!attribute [rw] if_metageneration_match + # @return [::Integer] + # Makes the operation only succeed conditional on whether the folder's + # current metageneration matches the given value. + # @!attribute [rw] if_metageneration_not_match + # @return [::Integer] + # Makes the operation only succeed conditional on whether the folder's + # current metageneration does not match the given value. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class GetFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateFolder. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the bucket in which the folder will reside. The bucket + # must be a hierarchical namespace enabled bucket. + # @!attribute [rw] folder + # @return [::Google::Cloud::Storage::Control::V2::Folder] + # Required. Properties of the new folder being created. + # The bucket and name of the folder are specified in the parent and folder_id + # fields, respectively. Populating those fields in `folder` will result in an + # error. + # @!attribute [rw] folder_id + # @return [::String] + # Required. The full name of a folder, including all its parent folders. + # Folders use single '/' characters as a delimiter. + # The folder_id must end with a slash. + # For example, the folder_id of "books/biographies/" would create a new + # "biographies/" folder under the "books/" folder. + # @!attribute [rw] recursive + # @return [::Boolean] + # Optional. If true, parent folder doesn't have to be present and all missing + # ancestor folders will be created atomically. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class CreateFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteFolder. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the folder. + # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + # @!attribute [rw] if_metageneration_match + # @return [::Integer] + # Makes the operation only succeed conditional on whether the folder's + # current metageneration matches the given value. + # @!attribute [rw] if_metageneration_not_match + # @return [::Integer] + # Makes the operation only succeed conditional on whether the folder's + # current metageneration does not match the given value. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class DeleteFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListFolders. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the bucket in which to look for folders. The bucket must + # be a hierarchical namespace enabled bucket. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of folders to return in a single response. The + # service will use this parameter or 1,000 items, whichever is smaller. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A previously-returned page token representing part of the larger + # set of results to view. + # @!attribute [rw] prefix + # @return [::String] + # Optional. Filter results to folders whose names begin with this prefix. + # If set, the value must either be an empty string or end with a '/'. + # @!attribute [rw] delimiter + # @return [::String] + # Optional. If set, returns results in a directory-like mode. The results + # will only include folders that either exactly match the above prefix, or + # are one level below the prefix. The only supported value is '/'. + # @!attribute [rw] lexicographic_start + # @return [::String] + # Optional. Filter results to folders whose names are lexicographically equal + # to or after lexicographic_start. If lexicographic_end is also set, the + # folders listed have names between lexicographic_start (inclusive) and + # lexicographic_end (exclusive). + # @!attribute [rw] lexicographic_end + # @return [::String] + # Optional. Filter results to folders whose names are lexicographically + # before lexicographic_end. If lexicographic_start is also set, the folders + # listed have names between lexicographic_start (inclusive) and + # lexicographic_end (exclusive). + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class ListFoldersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListFolders. + # @!attribute [rw] folders + # @return [::Array<::Google::Cloud::Storage::Control::V2::Folder>] + # The list of child folders + # @!attribute [rw] next_page_token + # @return [::String] + # The continuation token, used to page through large result sets. Provide + # this value in a subsequent request to return the next page of results. + class ListFoldersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for RenameFolder. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the source folder being renamed. + # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` + # @!attribute [rw] destination_folder_id + # @return [::String] + # Required. The destination folder ID, e.g. `foo/bar/`. + # @!attribute [rw] if_metageneration_match + # @return [::Integer] + # Makes the operation only succeed conditional on whether the source + # folder's current metageneration matches the given value. + # @!attribute [rw] if_metageneration_not_match + # @return [::Integer] + # Makes the operation only succeed conditional on whether the source + # folder's current metageneration does not match the given value. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + class RenameFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteFolderRecursive. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the folder being deleted, however all of its contents + # will be deleted too. Format: + # `projects/{project}/buckets/{bucket}/folders/{folder}` + # @!attribute [rw] if_metageneration_match + # @return [::Integer] + # Optional. Makes the operation only succeed conditional on whether the root + # folder's current metageneration matches the given value. + # @!attribute [rw] if_metageneration_not_match + # @return [::Integer] + # Optional. Makes the operation only succeed conditional on whether the root + # folder's current metageneration does not match the given value. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class DeleteFolderRecursiveRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The message contains metadata that is common to all Storage Control + # long-running operations, present in its `google.longrunning.Operation` + # messages, and accessible via `metadata.common_metadata`. + # @!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] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was last modified. + # @!attribute [r] type + # @return [::String] + # Output only. The type of operation invoked. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation. + # @!attribute [r] progress_percent + # @return [::Integer] + # Output only. The estimated progress of the operation in percentage [0, + # 100]. The value -1 means the progress is unknown. + class CommonLongRunningOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message returned in the metadata field of the Operation resource for + # RenameFolder operations. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] + # Generic metadata for the long running operation. + # @!attribute [rw] source_folder_id + # @return [::String] + # The path of the source folder. + # @!attribute [rw] destination_folder_id + # @return [::String] + # The path of the destination folder. + class RenameFolderMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message returned in the metadata field of the Operation resource for + # DeleteFolderRecursive operations. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] + # Generic metadata for the long running operation. + # @!attribute [rw] folder_id + # @return [::String] + # The path of the folder recursively deleted. + class DeleteFolderRecursiveMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The storage layout configuration of a bucket. + # @!attribute [r] name + # @return [::String] + # Output only. The name of the StorageLayout resource. + # Format: `projects/{project}/buckets/{bucket}/storageLayout` + # @!attribute [r] location + # @return [::String] + # Output only. The location of the bucket. + # @!attribute [r] location_type + # @return [::String] + # Output only. The location type of the bucket (region, dual-region, + # multi-region, etc). + # @!attribute [r] custom_placement_config + # @return [::Google::Cloud::Storage::Control::V2::StorageLayout::CustomPlacementConfig] + # Output only. The data placement configuration for custom dual region. If + # there is no configuration, this is not a custom dual region bucket. + # @!attribute [r] hierarchical_namespace + # @return [::Google::Cloud::Storage::Control::V2::StorageLayout::HierarchicalNamespace] + # Output only. The bucket's hierarchical namespace configuration. If there is + # no configuration, the hierarchical namespace is disabled. + class StorageLayout + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration for Custom Dual Regions. It should specify precisely two + # eligible regions within the same Multiregion. More information on regions + # may be found [here](https://cloud.google.com/storage/docs/locations). + # @!attribute [rw] data_locations + # @return [::Array<::String>] + # List of locations to use for data placement. + class CustomPlacementConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for a bucket's hierarchical namespace feature. + # @!attribute [rw] enabled + # @return [::Boolean] + # Enables the hierarchical namespace feature. + class HierarchicalNamespace + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for GetStorageLayout. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the StorageLayout resource. + # Format: `projects/{project}/buckets/{bucket}/storageLayout` + # @!attribute [rw] prefix + # @return [::String] + # An optional prefix used for permission check. It is useful when the caller + # only has limited permissions under a specific prefix. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class GetStorageLayoutRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A managed folder. + # @!attribute [rw] name + # @return [::String] + # Identifier. The name of this managed folder. + # Format: + # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + # @!attribute [r] metageneration + # @return [::Integer] + # Output only. The metadata version of this managed folder. It increases + # whenever the metadata is updated. Used for preconditions and for detecting + # changes in metadata. Managed folders don't have a generation number. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation time of the managed folder. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The modification time of the managed folder. + class ManagedFolder + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetManagedFolder. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the managed folder. + # Format: + # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + # @!attribute [rw] if_metageneration_match + # @return [::Integer] + # The operation succeeds conditional on the managed folder's current + # metageneration matching the value here specified. + # @!attribute [rw] if_metageneration_not_match + # @return [::Integer] + # The operation succeeds conditional on the managed folder's current + # metageneration NOT matching the value here specified. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class GetManagedFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateManagedFolder. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the bucket this managed folder belongs to. + # @!attribute [rw] managed_folder + # @return [::Google::Cloud::Storage::Control::V2::ManagedFolder] + # Required. Properties of the managed folder being created. + # The bucket and managed folder names are specified in the `parent` and + # `managed_folder_id` fields. Populating these fields in `managed_folder` + # will result in an error. + # @!attribute [rw] managed_folder_id + # @return [::String] + # Required. The name of the managed folder. It uses a single `/` as delimiter + # and leading and trailing `/` are allowed. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class CreateManagedFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # DeleteManagedFolder RPC request message. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the managed folder. + # Format: + # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` + # @!attribute [rw] if_metageneration_match + # @return [::Integer] + # The operation succeeds conditional on the managed folder's current + # metageneration matching the value here specified. + # @!attribute [rw] if_metageneration_not_match + # @return [::Integer] + # The operation succeeds conditional on the managed folder's current + # metageneration NOT matching the value here specified. + # @!attribute [rw] allow_non_empty + # @return [::Boolean] + # Allows deletion of a managed folder even if it is not empty. + # A managed folder is empty if it manages no child managed folders or + # objects. Caller must have permission for + # storage.managedFolders.setIamPolicy. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class DeleteManagedFolderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListManagedFolders. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the bucket this managed folder belongs to. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of managed folders to return in a single response. + # The service will use this parameter or 1,000 items, whichever is smaller. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A previously-returned page token representing part of the larger + # set of results to view. + # @!attribute [rw] prefix + # @return [::String] + # Optional. Filter results to match managed folders with name starting with + # this prefix. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class ListManagedFoldersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListManagedFolders. + # @!attribute [rw] managed_folders + # @return [::Array<::Google::Cloud::Storage::Control::V2::ManagedFolder>] + # The list of matching managed folders + # @!attribute [rw] next_page_token + # @return [::String] + # The continuation token, used to page through large result sets. Provide + # this value in a subsequent request to return the next page of results. + class ListManagedFoldersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message returned in the metadata field of the Operation resource for + # CreateAnywhereCache operations. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] + # Generic metadata for the long running operation. + # @!attribute [rw] anywhere_cache_id + # @return [::String] + # Anywhere Cache ID. + # @!attribute [rw] zone + # @return [::String] + # The zone in which the cache instance is running. For example, + # us-central1-a. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Anywhere Cache entry's TTL. A cache-level config that is applied to all new + # cache entries on admission. Default ttl value (24hrs) is applied if not + # specified in the create request. + # @!attribute [rw] admission_policy + # @return [::String] + # Anywhere Cache entry Admission Policy in kebab-case (e.g., + # "admit-on-first-miss"). Default admission policy (admit-on-first-miss) is + # applied if not specified in the create request. + class CreateAnywhereCacheMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message returned in the metadata field of the Operation resource for + # UpdateAnywhereCache operation. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] + # Generic metadata for the long running operation. + # @!attribute [rw] anywhere_cache_id + # @return [::String] + # Anywhere Cache ID. + # @!attribute [rw] zone + # @return [::String] + # The zone in which the cache instance is running. For example, + # us-central1-a. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Anywhere Cache entry's TTL between 1h and 7days. A cache-level config that + # is applied to all new cache entries on admission. If `ttl` is pending + # update, this field equals to the new value specified in the Update request. + # @!attribute [rw] admission_policy + # @return [::String] + # L4 Cache entry Admission Policy in kebab-case (e.g., + # "admit-on-first-miss"). If `admission_policy` is pending + # update, this field equals to the new value specified in the Update request. + class UpdateAnywhereCacheMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An Anywhere Cache Instance. + # @!attribute [rw] name + # @return [::String] + # Immutable. The resource name of this AnywhereCache. + # Format: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @!attribute [rw] zone + # @return [::String] + # Immutable. The zone in which the cache instance is running. For example, + # us-central1-a. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Cache entry TTL (ranges between 1h to 7d). This is a cache-level config + # that defines how long a cache entry can live. Default ttl value (24hrs) + # is applied if not specified in the create request. TTL must be in whole + # seconds. + # @!attribute [rw] admission_policy + # @return [::String] + # Cache admission policy. Valid policies includes: + # `admit-on-first-miss` and `admit-on-second-miss`. Defaults to + # `admit-on-first-miss`. Default value is applied if not specified in the + # create request. + # @!attribute [r] state + # @return [::String] + # Output only. Cache state including RUNNING, CREATING, DISABLED and PAUSED. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when Anywhere cache instance is allocated. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when Anywhere cache instance is last updated, including + # creation. + # @!attribute [r] pending_update + # @return [::Boolean] + # Output only. True if there is an active update operation against this cache + # instance. Subsequential update requests will be rejected if this field is + # true. Output only. + class AnywhereCache + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateAnywhereCache. + # @!attribute [rw] parent + # @return [::String] + # Required. The bucket to which this cache belongs. + # Format: `projects/{project}/buckets/{bucket}` + # @!attribute [rw] anywhere_cache + # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # Required. Properties of the Anywhere Cache instance being created. + # The parent bucket name is specified in the `parent` field. Server uses the + # default value of `ttl` or `admission_policy` if not specified in + # request. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + class CreateAnywhereCacheRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateAnywhereCache. + # @!attribute [rw] anywhere_cache + # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] + # Required. The Anywhere Cache instance to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. List of fields to be updated. Mutable fields of AnywhereCache + # include `ttl` and `admission_policy`. + # + # To specify ALL fields, specify a single field with the value `*`. Note: We + # recommend against doing this. If a new field is introduced at a later time, + # an older client updating with the `*` may accidentally reset the new + # field's value. + # + # Not specifying any fields is an error. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + class UpdateAnywhereCacheRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DisableAnywhereCache. + # @!attribute [rw] name + # @return [::String] + # Required. The name field in the request should be: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + class DisableAnywhereCacheRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for PauseAnywhereCache. + # @!attribute [rw] name + # @return [::String] + # Required. The name field in the request should be: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + class PauseAnywhereCacheRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ResumeAnywhereCache. + # @!attribute [rw] name + # @return [::String] + # Required. The name field in the request should be: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. This request is only + # idempotent if a `request_id` is provided. + class ResumeAnywhereCacheRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetAnywhereCache. + # @!attribute [rw] name + # @return [::String] + # Required. The name field in the request should be: + # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class GetAnywhereCacheRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListAnywhereCaches. + # @!attribute [rw] parent + # @return [::String] + # Required. The bucket to which this cache belongs. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of caches to return in a single response. + # The service will use this parameter or 1,000 items, whichever is smaller. + # @!attribute [rw] page_token + # @return [::String] + # A previously-returned page token representing part of the larger set of + # results to view. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class ListAnywhereCachesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListAnywhereCaches. + # @!attribute [rw] anywhere_caches + # @return [::Array<::Google::Cloud::Storage::Control::V2::AnywhereCache>] + # The list of items. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListAnywhereCachesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The `IntelligenceConfig` resource associated with your organization, folder, + # or project. + # @!attribute [rw] name + # @return [::String] + # Identifier. The name of the `IntelligenceConfig` resource associated with + # your organization, folder, or project. + # + # The name format varies based on the GCP resource hierarchy as follows: + # + # * For project: + # `projects/{project_number}/locations/global/intelligenceConfig` + # * For organization: + # `organizations/{org_id}/locations/global/intelligenceConfig` + # * For folder: `folders/{folder_id}/locations/global/intelligenceConfig` + # @!attribute [rw] edition_config + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::EditionConfig] + # Optional. The edition configuration of the `IntelligenceConfig` resource. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the `IntelligenceConfig` resource is last + # updated. + # @!attribute [rw] filter + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter] + # Optional. Filter over location and bucket. + # @!attribute [r] effective_intelligence_config + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::EffectiveIntelligenceConfig] + # Output only. The `IntelligenceConfig` resource that is applicable for the + # resource. + # @!attribute [rw] trial_config + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::TrialConfig] + # The trial configuration of the `IntelligenceConfig` resource. + class IntelligenceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Filter over location and bucket using include or exclude semantics. + # Resources that match the include or exclude filter are exclusively included + # or excluded from the Storage Intelligence plan. + # @!attribute [rw] included_cloud_storage_locations + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter::CloudStorageLocations] + # Bucket locations to include. + # + # Note: The following fields are mutually exclusive: `included_cloud_storage_locations`, `excluded_cloud_storage_locations`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] excluded_cloud_storage_locations + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter::CloudStorageLocations] + # Bucket locations to exclude. + # + # Note: The following fields are mutually exclusive: `excluded_cloud_storage_locations`, `included_cloud_storage_locations`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] included_cloud_storage_buckets + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter::CloudStorageBuckets] + # Buckets to include. + # + # Note: The following fields are mutually exclusive: `included_cloud_storage_buckets`, `excluded_cloud_storage_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] excluded_cloud_storage_buckets + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter::CloudStorageBuckets] + # Buckets to exclude. + # + # Note: The following fields are mutually exclusive: `excluded_cloud_storage_buckets`, `included_cloud_storage_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Filter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Collection of bucket locations. + # @!attribute [rw] locations + # @return [::Array<::String>] + # Optional. Bucket locations. Location can be any of the Cloud Storage + # regions specified in lower case format. For example, `us-east1`, + # `us-west1`. + class CloudStorageLocations + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Collection of buckets. + # @!attribute [rw] bucket_id_regexes + # @return [::Array<::String>] + # Optional. A regex pattern for matching bucket names. Regex should + # follow the syntax specified in + # [google/re2](https://github.com/google/re2). For example, + # `^sample_.*` matches all buckets of the form + # `gs://sample_bucket-1`, `gs://sample_bucket-2`, + # `gs://sample_bucket-n` but not `gs://test_sample_bucket`. + # If you want to match a single bucket, say `gs://sample_bucket`, + # use `sample_bucket`. + class CloudStorageBuckets + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The effective `IntelligenceConfig` for the resource. + # @!attribute [r] effective_edition + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::EffectiveIntelligenceConfig::EffectiveEdition] + # Output only. The `IntelligenceConfig` edition that is applicable for the + # resource. + # @!attribute [r] intelligence_config + # @return [::String] + # Output only. The `IntelligenceConfig` resource that is applied for the + # target resource. Format: + # `{organizations|folders|projects}/{id}/locations/{location}/intelligenceConfig` + class EffectiveIntelligenceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The effective edition of the `IntelligenceConfig` resource. + module EffectiveEdition + # This is an unknown edition of the resource. + EFFECTIVE_EDITION_UNSPECIFIED = 0 + + # No edition. + NONE = 1 + + # The `IntelligenceConfig` resource is of STANDARD edition. + STANDARD = 2 + end + end + + # The trial configuration of the `IntelligenceConfig` resource. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the trial expires. + class TrialConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The edition configuration of the `IntelligenceConfig` resource. This + # signifies the edition used for configuring the `IntelligenceConfig` + # resource and can only take the following values: + # `EDITION_CONFIG_UNSPECIFIED`, `INHERIT`, `DISABLED`, `STANDARD` and + # `TRIAL`. + module EditionConfig + # This is an unknown edition of the resource. + EDITION_CONFIG_UNSPECIFIED = 0 + + # The inherited edition from the parent and filters. This is the default + # edition when there is no `IntelligenceConfig` setup for a GCP resource. + INHERIT = 1 + + # The edition configuration is disabled for the `IntelligenceConfig` + # resource and its children. Filters are not applicable. + DISABLED = 2 + + # The `IntelligenceConfig` resource is of STANDARD edition. + STANDARD = 3 + + # The `IntelligenceConfig` resource is available in `TRIAL` edition. During + # the trial period, Cloud Storage does not charge for Storage Intelligence + # usage. You can specify the buckets to include in the trial period by + # using filters. At the end of the trial period, the `IntelligenceConfig` + # resource is upgraded to `STANDARD` edition. + TRIAL = 5 + end + end + + # Request message to update the `IntelligenceConfig` resource associated with + # your organization. + # + # **IAM Permissions**: + # + # Requires `storage.intelligenceConfigs.update` + # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on + # the organization. + # @!attribute [rw] intelligence_config + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # Required. The `IntelligenceConfig` resource to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @!attribute [rw] request_id + # @return [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + class UpdateOrganizationIntelligenceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to update the `IntelligenceConfig` resource associated with + # your folder. + # + # **IAM Permissions**: + # + # Requires `storage.intelligenceConfigs.update` + # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on + # the folder. + # @!attribute [rw] intelligence_config + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # Required. The `IntelligenceConfig` resource to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @!attribute [rw] request_id + # @return [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + class UpdateFolderIntelligenceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to update the `IntelligenceConfig` resource associated with + # your project. + # + # **IAM Permissions**: + # + # Requires `storage.intelligenceConfigs.update` + # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on + # the folder. + # @!attribute [rw] intelligence_config + # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] + # Required. The `IntelligenceConfig` resource to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The `update_mask` that specifies the fields within the + # `IntelligenceConfig` resource that should be modified by this update. Only + # the listed fields are updated. + # @!attribute [rw] request_id + # @return [::String] + # Optional. The ID that uniquely identifies the request, preventing duplicate + # processing. + class UpdateProjectIntelligenceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to get the `IntelligenceConfig` resource associated with your + # organization. + # + # **IAM Permissions** + # + # Requires `storage.intelligenceConfigs.get` + # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on + # the organization. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your organization. + # + # Format: `organizations/{org_id}/locations/global/intelligenceConfig` + class GetOrganizationIntelligenceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to get the `IntelligenceConfig` resource associated with your + # folder. + # + # **IAM Permissions** + # + # Requires `storage.intelligenceConfigs.get` + # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on + # the folder. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your folder. + # + # Format: `folders/{id}/locations/global/intelligenceConfig` + class GetFolderIntelligenceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to get the `IntelligenceConfig` resource associated with your + # project. + # + # **IAM Permissions**: + # + # Requires `storage.intelligenceConfigs.get` + # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission + # on the project. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the `IntelligenceConfig` resource associated with + # your project. + # + # Format: `projects/{id}/locations/global/intelligenceConfig` + class GetProjectIntelligenceConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module 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-storage-control-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-storage-control-v2/snippets/Gemfile new file mode 100644 index 000000000000..2d9a5aa92db0 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/Gemfile @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +source "https://rubygems.org" + +if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + gem "google-cloud-storage-control-v2", path: "../" +else + gem "google-cloud-storage-control-v2" +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-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json b/owl-bot-staging/google-cloud-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json new file mode 100644 index 000000000000..79b7fb355379 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json @@ -0,0 +1,1095 @@ +{ + "client_library": { + "name": "google-cloud-storage-control-v2", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.storage.control.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "region_tag": "storage_v2_generated_StorageControl_CreateFolder_sync", + "title": "Snippet for the create_folder call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#create_folder.", + "file": "storage_control/create_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_folder", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#create_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::CreateFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::Folder", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "CreateFolder", + "full_name": "google.storage.control.v2.StorageControl.CreateFolder", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_DeleteFolder_sync", + "title": "Snippet for the delete_folder call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder.", + "file": "storage_control/delete_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_folder", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::DeleteFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "DeleteFolder", + "full_name": "google.storage.control.v2.StorageControl.DeleteFolder", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_GetFolder_sync", + "title": "Snippet for the get_folder call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder.", + "file": "storage_control/get_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_folder", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::GetFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::Folder", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "GetFolder", + "full_name": "google.storage.control.v2.StorageControl.GetFolder", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_ListFolders_sync", + "title": "Snippet for the list_folders call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#list_folders.", + "file": "storage_control/list_folders.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_folders", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#list_folders", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::ListFoldersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::ListFoldersResponse", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "ListFolders", + "full_name": "google.storage.control.v2.StorageControl.ListFolders", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_RenameFolder_sync", + "title": "Snippet for the rename_folder call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#rename_folder.", + "file": "storage_control/rename_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "rename_folder", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#rename_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::RenameFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "RenameFolder", + "full_name": "google.storage.control.v2.StorageControl.RenameFolder", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_DeleteFolderRecursive_sync", + "title": "Snippet for the delete_folder_recursive call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder_recursive.", + "file": "storage_control/delete_folder_recursive.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_folder_recursive", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder_recursive", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "DeleteFolderRecursive", + "full_name": "google.storage.control.v2.StorageControl.DeleteFolderRecursive", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_GetStorageLayout_sync", + "title": "Snippet for the get_storage_layout call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_storage_layout.", + "file": "storage_control/get_storage_layout.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_storage_layout", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_storage_layout", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::StorageLayout", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "GetStorageLayout", + "full_name": "google.storage.control.v2.StorageControl.GetStorageLayout", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_CreateManagedFolder_sync", + "title": "Snippet for the create_managed_folder call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#create_managed_folder.", + "file": "storage_control/create_managed_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_managed_folder", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#create_managed_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::ManagedFolder", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "CreateManagedFolder", + "full_name": "google.storage.control.v2.StorageControl.CreateManagedFolder", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_DeleteManagedFolder_sync", + "title": "Snippet for the delete_managed_folder call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_managed_folder.", + "file": "storage_control/delete_managed_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_managed_folder", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_managed_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "DeleteManagedFolder", + "full_name": "google.storage.control.v2.StorageControl.DeleteManagedFolder", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_GetManagedFolder_sync", + "title": "Snippet for the get_managed_folder call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_managed_folder.", + "file": "storage_control/get_managed_folder.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_managed_folder", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_managed_folder", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::ManagedFolder", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "GetManagedFolder", + "full_name": "google.storage.control.v2.StorageControl.GetManagedFolder", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_ListManagedFolders_sync", + "title": "Snippet for the list_managed_folders call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#list_managed_folders.", + "file": "storage_control/list_managed_folders.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_managed_folders", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#list_managed_folders", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::ListManagedFoldersResponse", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "ListManagedFolders", + "full_name": "google.storage.control.v2.StorageControl.ListManagedFolders", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_CreateAnywhereCache_sync", + "title": "Snippet for the create_anywhere_cache call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#create_anywhere_cache.", + "file": "storage_control/create_anywhere_cache.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_anywhere_cache", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#create_anywhere_cache", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "CreateAnywhereCache", + "full_name": "google.storage.control.v2.StorageControl.CreateAnywhereCache", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_UpdateAnywhereCache_sync", + "title": "Snippet for the update_anywhere_cache call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#update_anywhere_cache.", + "file": "storage_control/update_anywhere_cache.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_anywhere_cache", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#update_anywhere_cache", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "UpdateAnywhereCache", + "full_name": "google.storage.control.v2.StorageControl.UpdateAnywhereCache", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_DisableAnywhereCache_sync", + "title": "Snippet for the disable_anywhere_cache call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#disable_anywhere_cache.", + "file": "storage_control/disable_anywhere_cache.rb", + "language": "RUBY", + "client_method": { + "short_name": "disable_anywhere_cache", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#disable_anywhere_cache", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::AnywhereCache", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "DisableAnywhereCache", + "full_name": "google.storage.control.v2.StorageControl.DisableAnywhereCache", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_PauseAnywhereCache_sync", + "title": "Snippet for the pause_anywhere_cache call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#pause_anywhere_cache.", + "file": "storage_control/pause_anywhere_cache.rb", + "language": "RUBY", + "client_method": { + "short_name": "pause_anywhere_cache", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#pause_anywhere_cache", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::AnywhereCache", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "PauseAnywhereCache", + "full_name": "google.storage.control.v2.StorageControl.PauseAnywhereCache", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_ResumeAnywhereCache_sync", + "title": "Snippet for the resume_anywhere_cache call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#resume_anywhere_cache.", + "file": "storage_control/resume_anywhere_cache.rb", + "language": "RUBY", + "client_method": { + "short_name": "resume_anywhere_cache", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#resume_anywhere_cache", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::AnywhereCache", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "ResumeAnywhereCache", + "full_name": "google.storage.control.v2.StorageControl.ResumeAnywhereCache", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_GetAnywhereCache_sync", + "title": "Snippet for the get_anywhere_cache call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_anywhere_cache.", + "file": "storage_control/get_anywhere_cache.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_anywhere_cache", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_anywhere_cache", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::AnywhereCache", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "GetAnywhereCache", + "full_name": "google.storage.control.v2.StorageControl.GetAnywhereCache", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_ListAnywhereCaches_sync", + "title": "Snippet for the list_anywhere_caches call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#list_anywhere_caches.", + "file": "storage_control/list_anywhere_caches.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_anywhere_caches", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#list_anywhere_caches", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::ListAnywhereCachesResponse", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "ListAnywhereCaches", + "full_name": "google.storage.control.v2.StorageControl.ListAnywhereCaches", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_GetProjectIntelligenceConfig_sync", + "title": "Snippet for the get_project_intelligence_config call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_project_intelligence_config.", + "file": "storage_control/get_project_intelligence_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_project_intelligence_config", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_project_intelligence_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "GetProjectIntelligenceConfig", + "full_name": "google.storage.control.v2.StorageControl.GetProjectIntelligenceConfig", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_UpdateProjectIntelligenceConfig_sync", + "title": "Snippet for the update_project_intelligence_config call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#update_project_intelligence_config.", + "file": "storage_control/update_project_intelligence_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_project_intelligence_config", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#update_project_intelligence_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "UpdateProjectIntelligenceConfig", + "full_name": "google.storage.control.v2.StorageControl.UpdateProjectIntelligenceConfig", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_GetFolderIntelligenceConfig_sync", + "title": "Snippet for the get_folder_intelligence_config call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder_intelligence_config.", + "file": "storage_control/get_folder_intelligence_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_folder_intelligence_config", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder_intelligence_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "GetFolderIntelligenceConfig", + "full_name": "google.storage.control.v2.StorageControl.GetFolderIntelligenceConfig", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_UpdateFolderIntelligenceConfig_sync", + "title": "Snippet for the update_folder_intelligence_config call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#update_folder_intelligence_config.", + "file": "storage_control/update_folder_intelligence_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_folder_intelligence_config", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#update_folder_intelligence_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "UpdateFolderIntelligenceConfig", + "full_name": "google.storage.control.v2.StorageControl.UpdateFolderIntelligenceConfig", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_GetOrganizationIntelligenceConfig_sync", + "title": "Snippet for the get_organization_intelligence_config call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_organization_intelligence_config.", + "file": "storage_control/get_organization_intelligence_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_organization_intelligence_config", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_organization_intelligence_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "GetOrganizationIntelligenceConfig", + "full_name": "google.storage.control.v2.StorageControl.GetOrganizationIntelligenceConfig", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_UpdateOrganizationIntelligenceConfig_sync", + "title": "Snippet for the update_organization_intelligence_config call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#update_organization_intelligence_config.", + "file": "storage_control/update_organization_intelligence_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_organization_intelligence_config", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#update_organization_intelligence_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "UpdateOrganizationIntelligenceConfig", + "full_name": "google.storage.control.v2.StorageControl.UpdateOrganizationIntelligenceConfig", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_iam_policy.", + "file": "storage_control/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.storage.control.v2.StorageControl.GetIamPolicy", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#set_iam_policy.", + "file": "storage_control/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.storage.control.v2.StorageControl.SetIamPolicy", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "storage_v2_generated_StorageControl_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#test_iam_permissions.", + "file": "storage_control/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.storage.control.v2.StorageControl.TestIamPermissions", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "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-storage-control-v2/snippets/storage_control/create_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_anywhere_cache.rb new file mode 100644 index 000000000000..bbd8060b1bd0 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_anywhere_cache.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_CreateAnywhereCache_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the create_anywhere_cache call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#create_anywhere_cache. +# +def create_anywhere_cache + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new + + # Call the create_anywhere_cache method. + result = client.create_anywhere_cache 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 storage_v2_generated_StorageControl_CreateAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_folder.rb new file mode 100644 index 000000000000..dd92a948086e --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_folder.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_CreateFolder_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the create_folder call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#create_folder. +# +def create_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::CreateFolderRequest.new + + # Call the create_folder method. + result = client.create_folder request + + # The returned object is of type Google::Cloud::Storage::Control::V2::Folder. + p result +end +# [END storage_v2_generated_StorageControl_CreateFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_managed_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_managed_folder.rb new file mode 100644 index 000000000000..e1fb93270c88 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_managed_folder.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_CreateManagedFolder_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the create_managed_folder call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#create_managed_folder. +# +def create_managed_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest.new + + # Call the create_managed_folder method. + result = client.create_managed_folder request + + # The returned object is of type Google::Cloud::Storage::Control::V2::ManagedFolder. + p result +end +# [END storage_v2_generated_StorageControl_CreateManagedFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder.rb new file mode 100644 index 000000000000..6527be8b6351 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_DeleteFolder_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the delete_folder call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#delete_folder. +# +def delete_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new + + # Call the delete_folder method. + result = client.delete_folder request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END storage_v2_generated_StorageControl_DeleteFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder_recursive.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder_recursive.rb new file mode 100644 index 000000000000..5e4a473b6602 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder_recursive.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_DeleteFolderRecursive_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the delete_folder_recursive call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#delete_folder_recursive. +# +def delete_folder_recursive + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new + + # Call the delete_folder_recursive method. + result = client.delete_folder_recursive 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 storage_v2_generated_StorageControl_DeleteFolderRecursive_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_managed_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_managed_folder.rb new file mode 100644 index 000000000000..cc6a608ab87f --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_managed_folder.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_DeleteManagedFolder_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the delete_managed_folder call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#delete_managed_folder. +# +def delete_managed_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest.new + + # Call the delete_managed_folder method. + result = client.delete_managed_folder request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END storage_v2_generated_StorageControl_DeleteManagedFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/disable_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/disable_anywhere_cache.rb new file mode 100644 index 000000000000..c2a2b8e4c3b7 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/disable_anywhere_cache.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_DisableAnywhereCache_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the disable_anywhere_cache call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#disable_anywhere_cache. +# +def disable_anywhere_cache + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new + + # Call the disable_anywhere_cache method. + result = client.disable_anywhere_cache request + + # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. + p result +end +# [END storage_v2_generated_StorageControl_DisableAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_anywhere_cache.rb new file mode 100644 index 000000000000..e71ce4780d7a --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_anywhere_cache.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_GetAnywhereCache_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the get_anywhere_cache call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#get_anywhere_cache. +# +def get_anywhere_cache + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new + + # Call the get_anywhere_cache method. + result = client.get_anywhere_cache request + + # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. + p result +end +# [END storage_v2_generated_StorageControl_GetAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder.rb new file mode 100644 index 000000000000..a48c2019212e --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_GetFolder_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the get_folder call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#get_folder. +# +def get_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::GetFolderRequest.new + + # Call the get_folder method. + result = client.get_folder request + + # The returned object is of type Google::Cloud::Storage::Control::V2::Folder. + p result +end +# [END storage_v2_generated_StorageControl_GetFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder_intelligence_config.rb new file mode 100644 index 000000000000..dad8ed93e7ba --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder_intelligence_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_GetFolderIntelligenceConfig_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the get_folder_intelligence_config call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#get_folder_intelligence_config. +# +def get_folder_intelligence_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new + + # Call the get_folder_intelligence_config method. + result = client.get_folder_intelligence_config request + + # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + p result +end +# [END storage_v2_generated_StorageControl_GetFolderIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_iam_policy.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_iam_policy.rb new file mode 100644 index 000000000000..349e334e7668 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_GetIamPolicy_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the get_iam_policy call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::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 storage_v2_generated_StorageControl_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_managed_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_managed_folder.rb new file mode 100644 index 000000000000..4456c65ead42 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_managed_folder.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_GetManagedFolder_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the get_managed_folder call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#get_managed_folder. +# +def get_managed_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::GetManagedFolderRequest.new + + # Call the get_managed_folder method. + result = client.get_managed_folder request + + # The returned object is of type Google::Cloud::Storage::Control::V2::ManagedFolder. + p result +end +# [END storage_v2_generated_StorageControl_GetManagedFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_organization_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_organization_intelligence_config.rb new file mode 100644 index 000000000000..3843e092f909 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_organization_intelligence_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_GetOrganizationIntelligenceConfig_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the get_organization_intelligence_config call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#get_organization_intelligence_config. +# +def get_organization_intelligence_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new + + # Call the get_organization_intelligence_config method. + result = client.get_organization_intelligence_config request + + # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + p result +end +# [END storage_v2_generated_StorageControl_GetOrganizationIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_project_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_project_intelligence_config.rb new file mode 100644 index 000000000000..63b47d76f5ce --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_project_intelligence_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_GetProjectIntelligenceConfig_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the get_project_intelligence_config call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#get_project_intelligence_config. +# +def get_project_intelligence_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new + + # Call the get_project_intelligence_config method. + result = client.get_project_intelligence_config request + + # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + p result +end +# [END storage_v2_generated_StorageControl_GetProjectIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_storage_layout.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_storage_layout.rb new file mode 100644 index 000000000000..b032cc0443a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_storage_layout.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_GetStorageLayout_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the get_storage_layout call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#get_storage_layout. +# +def get_storage_layout + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new + + # Call the get_storage_layout method. + result = client.get_storage_layout request + + # The returned object is of type Google::Cloud::Storage::Control::V2::StorageLayout. + p result +end +# [END storage_v2_generated_StorageControl_GetStorageLayout_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_anywhere_caches.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_anywhere_caches.rb new file mode 100644 index 000000000000..125771ab1c46 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_anywhere_caches.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_ListAnywhereCaches_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the list_anywhere_caches call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#list_anywhere_caches. +# +def list_anywhere_caches + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new + + # Call the list_anywhere_caches method. + result = client.list_anywhere_caches 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::Storage::Control::V2::AnywhereCache. + p item + end +end +# [END storage_v2_generated_StorageControl_ListAnywhereCaches_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_folders.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_folders.rb new file mode 100644 index 000000000000..a14428976afa --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_folders.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_ListFolders_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the list_folders call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#list_folders. +# +def list_folders + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::ListFoldersRequest.new + + # Call the list_folders method. + result = client.list_folders 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::Storage::Control::V2::Folder. + p item + end +end +# [END storage_v2_generated_StorageControl_ListFolders_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_managed_folders.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_managed_folders.rb new file mode 100644 index 000000000000..199fdd2fb572 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_managed_folders.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_ListManagedFolders_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the list_managed_folders call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#list_managed_folders. +# +def list_managed_folders + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest.new + + # Call the list_managed_folders method. + result = client.list_managed_folders 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::Storage::Control::V2::ManagedFolder. + p item + end +end +# [END storage_v2_generated_StorageControl_ListManagedFolders_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/pause_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/pause_anywhere_cache.rb new file mode 100644 index 000000000000..ba92a11e170d --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/pause_anywhere_cache.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_PauseAnywhereCache_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the pause_anywhere_cache call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#pause_anywhere_cache. +# +def pause_anywhere_cache + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new + + # Call the pause_anywhere_cache method. + result = client.pause_anywhere_cache request + + # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. + p result +end +# [END storage_v2_generated_StorageControl_PauseAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/rename_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/rename_folder.rb new file mode 100644 index 000000000000..f44abdfe039b --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/rename_folder.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_RenameFolder_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the rename_folder call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#rename_folder. +# +def rename_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::RenameFolderRequest.new + + # Call the rename_folder method. + result = client.rename_folder 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 storage_v2_generated_StorageControl_RenameFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/resume_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/resume_anywhere_cache.rb new file mode 100644 index 000000000000..4302ff5de677 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/resume_anywhere_cache.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_ResumeAnywhereCache_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the resume_anywhere_cache call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#resume_anywhere_cache. +# +def resume_anywhere_cache + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new + + # Call the resume_anywhere_cache method. + result = client.resume_anywhere_cache request + + # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. + p result +end +# [END storage_v2_generated_StorageControl_ResumeAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/set_iam_policy.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/set_iam_policy.rb new file mode 100644 index 000000000000..e73a4d5d1de2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/set_iam_policy.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_SetIamPolicy_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the set_iam_policy call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::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 storage_v2_generated_StorageControl_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/test_iam_permissions.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/test_iam_permissions.rb new file mode 100644 index 000000000000..485086025053 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/test_iam_permissions.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_TestIamPermissions_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the test_iam_permissions call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::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 storage_v2_generated_StorageControl_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_anywhere_cache.rb new file mode 100644 index 000000000000..57d4f56505f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_anywhere_cache.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_UpdateAnywhereCache_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the update_anywhere_cache call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#update_anywhere_cache. +# +def update_anywhere_cache + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new + + # Call the update_anywhere_cache method. + result = client.update_anywhere_cache 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 storage_v2_generated_StorageControl_UpdateAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_folder_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_folder_intelligence_config.rb new file mode 100644 index 000000000000..c44d13080aa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_folder_intelligence_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_UpdateFolderIntelligenceConfig_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the update_folder_intelligence_config call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#update_folder_intelligence_config. +# +def update_folder_intelligence_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new + + # Call the update_folder_intelligence_config method. + result = client.update_folder_intelligence_config request + + # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + p result +end +# [END storage_v2_generated_StorageControl_UpdateFolderIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_organization_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_organization_intelligence_config.rb new file mode 100644 index 000000000000..150381470100 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_organization_intelligence_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_UpdateOrganizationIntelligenceConfig_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the update_organization_intelligence_config call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#update_organization_intelligence_config. +# +def update_organization_intelligence_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new + + # Call the update_organization_intelligence_config method. + result = client.update_organization_intelligence_config request + + # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + p result +end +# [END storage_v2_generated_StorageControl_UpdateOrganizationIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_project_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_project_intelligence_config.rb new file mode 100644 index 000000000000..56d206d78ff1 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_project_intelligence_config.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START storage_v2_generated_StorageControl_UpdateProjectIntelligenceConfig_sync] +require "google/cloud/storage/control/v2" + +## +# Snippet for the update_project_intelligence_config call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#update_project_intelligence_config. +# +def update_project_intelligence_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new + + # Call the update_project_intelligence_config method. + result = client.update_project_intelligence_config request + + # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. + p result +end +# [END storage_v2_generated_StorageControl_UpdateProjectIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_operations_test.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_operations_test.rb new file mode 100644 index 000000000000..39b7bd9a10d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/storage/control/v2/storage_control_pb" +require "google/storage/control/v2/storage_control_services_pb" +require "google/cloud/storage/control/v2/storage_control" + +class ::Google::Cloud::Storage::Control::V2::StorageControl::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) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_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" + return_partial_success = true + + 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"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_paths_test.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_paths_test.rb new file mode 100644 index 000000000000..77eb67a52960 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_paths_test.rb @@ -0,0 +1,121 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/storage/control/v2/storage_control" + +class ::Google::Cloud::Storage::Control::V2::StorageControl::ClientPathsTest < Minitest::Test + class DummyStub + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_anywhere_cache_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.anywhere_cache_path project: "value0", bucket: "value1", anywhere_cache: "value2" + assert_equal "projects/value0/buckets/value1/anywhereCaches/value2", path + end + end + + def test_bucket_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.bucket_path project: "value0", bucket: "value1" + assert_equal "projects/value0/buckets/value1", path + end + end + + def test_folder_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.folder_path project: "value0", bucket: "value1", folder: "value2" + assert_equal "projects/value0/buckets/value1/folders/value2", path + end + end + + def test_intelligence_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.intelligence_config_path folder: "value0", location: "value1" + assert_equal "folders/value0/locations/value1/intelligenceConfig", path + + path = client.intelligence_config_path org: "value0", location: "value1" + assert_equal "organizations/value0/locations/value1/intelligenceConfig", path + + path = client.intelligence_config_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/intelligenceConfig", path + end + end + + def test_managed_folder_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.managed_folder_path project: "value0", bucket: "value1", managed_folder: "value2" + assert_equal "projects/value0/buckets/value1/managedFolders/value2", path + end + end + + def test_storage_layout_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.storage_layout_path project: "value0", bucket: "value1" + assert_equal "projects/value0/buckets/value1/storageLayout", path + end + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_rest_test.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_rest_test.rb new file mode 100644 index 000000000000..e8890b18eec3 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_rest_test.rb @@ -0,0 +1,429 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/storage/control/v2/storage_control_pb" +require "google/cloud/storage/control/v2/storage_control/rest" + + +class ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_count, :requests + + def initialize response, &block + @response = response + @block = block + @call_count = 0 + @requests = [] + end + + def make_get_request uri:, params: {}, options: {}, method_name: nil + make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_delete_request uri:, params: {}, options: {}, method_name: nil + make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name + end + + def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil + make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_put_request uri:, body:, params: {}, options: {}, method_name: nil + make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name + end + + def make_http_request *args, **kwargs + @call_count += 1 + + @requests << @block&.call(*args, **kwargs) + + @response + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_get_project_intelligence_config + # Create test objects. + client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_project_intelligence_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_get_project_intelligence_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_project_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_project_intelligence_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_project_intelligence_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_project_intelligence_config ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_project_intelligence_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_project_intelligence_config(::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_project_intelligence_config_client_stub.call_count + end + end + end + + def test_update_project_intelligence_config + # Create test objects. + client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + intelligence_config = {} + update_mask = {} + request_id = "hello world" + + update_project_intelligence_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_update_project_intelligence_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_project_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_project_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_project_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_project_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_project_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_project_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_project_intelligence_config_client_stub.call_count + end + end + end + + def test_get_folder_intelligence_config + # Create test objects. + client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_folder_intelligence_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_get_folder_intelligence_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_folder_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_folder_intelligence_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_folder_intelligence_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_folder_intelligence_config ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_folder_intelligence_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_folder_intelligence_config(::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_folder_intelligence_config_client_stub.call_count + end + end + end + + def test_update_folder_intelligence_config + # Create test objects. + client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + intelligence_config = {} + update_mask = {} + request_id = "hello world" + + update_folder_intelligence_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_update_folder_intelligence_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_folder_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_folder_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_folder_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_folder_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_folder_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_folder_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_folder_intelligence_config_client_stub.call_count + end + end + end + + def test_get_organization_intelligence_config + # Create test objects. + client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_organization_intelligence_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_get_organization_intelligence_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_organization_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_organization_intelligence_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_organization_intelligence_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_organization_intelligence_config ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_organization_intelligence_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_organization_intelligence_config(::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_organization_intelligence_config_client_stub.call_count + end + end + end + + def test_update_organization_intelligence_config + # Create test objects. + client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + intelligence_config = {} + update_mask = {} + request_id = "hello world" + + update_organization_intelligence_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_update_organization_intelligence_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_organization_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_organization_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_organization_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_organization_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_organization_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_organization_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_organization_intelligence_config_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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb new file mode 100644 index 000000000000..d85897291ac9 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb @@ -0,0 +1,1853 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/storage/control/v2/storage_control_pb" +require "google/cloud/storage/control/v2/storage_control" + +class ::Google::Cloud::Storage::Control::V2::StorageControl::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_folder + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::Folder.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" + folder = {} + folder_id = "hello world" + recursive = true + request_id = "hello world" + + create_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_folder, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::CreateFolderRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::Folder), request["folder"] + assert_equal "hello world", request["folder_id"] + assert_equal true, request["recursive"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_folder_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_folder({ parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_folder parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_folder ::Google::Cloud::Storage::Control::V2::CreateFolderRequest.new(parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, 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_folder({ parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, 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_folder(::Google::Cloud::Storage::Control::V2::CreateFolderRequest.new(parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, 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_folder_client_stub.call_rpc_count + end + end + + def test_delete_folder + # 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" + if_metageneration_match = 42 + if_metageneration_not_match = 42 + request_id = "hello world" + + delete_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_folder, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["if_metageneration_match"] + assert request.has_if_metageneration_match? + assert_equal 42, request["if_metageneration_not_match"] + assert request.has_if_metageneration_not_match? + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_folder_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_folder name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_folder ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.delete_folder(::Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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, delete_folder_client_stub.call_rpc_count + end + end + + def test_get_folder + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::Folder.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" + if_metageneration_match = 42 + if_metageneration_not_match = 42 + request_id = "hello world" + + get_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_folder, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::GetFolderRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["if_metageneration_match"] + assert request.has_if_metageneration_match? + assert_equal 42, request["if_metageneration_not_match"] + assert request.has_if_metageneration_not_match? + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_folder_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_folder name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_folder ::Google::Cloud::Storage::Control::V2::GetFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.get_folder(::Google::Cloud::Storage::Control::V2::GetFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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, get_folder_client_stub.call_rpc_count + end + end + + def test_list_folders + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::ListFoldersResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + prefix = "hello world" + delimiter = "hello world" + lexicographic_start = "hello world" + lexicographic_end = "hello world" + request_id = "hello world" + + list_folders_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_folders, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::ListFoldersRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["prefix"] + assert_equal "hello world", request["delimiter"] + assert_equal "hello world", request["lexicographic_start"] + assert_equal "hello world", request["lexicographic_end"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_folders_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_folders({ parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id }) 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_folders parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id 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_folders ::Google::Cloud::Storage::Control::V2::ListFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id) 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_folders({ parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id }, 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_folders(::Google::Cloud::Storage::Control::V2::ListFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id), 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_folders_client_stub.call_rpc_count + end + end + + def test_rename_folder + # 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" + destination_folder_id = "hello world" + if_metageneration_match = 42 + if_metageneration_not_match = 42 + request_id = "hello world" + + rename_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :rename_folder, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::RenameFolderRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["destination_folder_id"] + assert_equal 42, request["if_metageneration_match"] + assert request.has_if_metageneration_match? + assert_equal 42, request["if_metageneration_not_match"] + assert request.has_if_metageneration_not_match? + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, rename_folder_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.rename_folder({ name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.rename_folder name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.rename_folder ::Google::Cloud::Storage::Control::V2::RenameFolderRequest.new(name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.rename_folder({ name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.rename_folder(::Google::Cloud::Storage::Control::V2::RenameFolderRequest.new(name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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, rename_folder_client_stub.call_rpc_count + end + end + + def test_delete_folder_recursive + # 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" + if_metageneration_match = 42 + if_metageneration_not_match = 42 + request_id = "hello world" + + delete_folder_recursive_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_folder_recursive, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["if_metageneration_match"] + assert request.has_if_metageneration_match? + assert_equal 42, request["if_metageneration_not_match"] + assert request.has_if_metageneration_not_match? + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_folder_recursive_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_folder_recursive({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive(::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive_client_stub.call_rpc_count + end + end + + def test_get_storage_layout + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::StorageLayout.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" + prefix = "hello world" + request_id = "hello world" + + get_storage_layout_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_storage_layout, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["prefix"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_storage_layout_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_storage_layout({ name: name, prefix: prefix, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_storage_layout name: name, prefix: prefix, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_storage_layout ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new(name: name, prefix: prefix, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_storage_layout({ name: name, prefix: prefix, 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.get_storage_layout(::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new(name: name, prefix: prefix, 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, get_storage_layout_client_stub.call_rpc_count + end + end + + def test_create_managed_folder + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::ManagedFolder.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" + managed_folder = {} + managed_folder_id = "hello world" + request_id = "hello world" + + create_managed_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_managed_folder, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::ManagedFolder), request["managed_folder"] + assert_equal "hello world", request["managed_folder_id"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_managed_folder_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_managed_folder({ parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_managed_folder parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_managed_folder ::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest.new(parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, 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_managed_folder({ parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, 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_managed_folder(::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest.new(parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, 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_managed_folder_client_stub.call_rpc_count + end + end + + def test_delete_managed_folder + # 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" + if_metageneration_match = 42 + if_metageneration_not_match = 42 + allow_non_empty = true + request_id = "hello world" + + delete_managed_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_managed_folder, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["if_metageneration_match"] + assert request.has_if_metageneration_match? + assert_equal 42, request["if_metageneration_not_match"] + assert request.has_if_metageneration_not_match? + assert_equal true, request["allow_non_empty"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_managed_folder_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_managed_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_managed_folder name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_managed_folder ::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_managed_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, 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.delete_managed_folder(::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, 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, delete_managed_folder_client_stub.call_rpc_count + end + end + + def test_get_managed_folder + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::ManagedFolder.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" + if_metageneration_match = 42 + if_metageneration_not_match = 42 + request_id = "hello world" + + get_managed_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_managed_folder, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["if_metageneration_match"] + assert request.has_if_metageneration_match? + assert_equal 42, request["if_metageneration_not_match"] + assert request.has_if_metageneration_not_match? + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_managed_folder_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_managed_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_managed_folder name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_managed_folder ::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_managed_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.get_managed_folder(::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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, get_managed_folder_client_stub.call_rpc_count + end + end + + def test_list_managed_folders + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::ListManagedFoldersResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + prefix = "hello world" + request_id = "hello world" + + list_managed_folders_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_managed_folders, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["prefix"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_managed_folders_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_managed_folders({ parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id }) 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_managed_folders parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id 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_managed_folders ::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id) 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_managed_folders({ parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id }, 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_managed_folders(::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id), 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_managed_folders_client_stub.call_rpc_count + end + end + + def test_create_anywhere_cache + # 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. + parent = "hello world" + anywhere_cache = {} + request_id = "hello world" + + create_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_anywhere_cache, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::AnywhereCache), request["anywhere_cache"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_anywhere_cache_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_anywhere_cache({ parent: parent, anywhere_cache: anywhere_cache, 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.create_anywhere_cache parent: parent, anywhere_cache: anywhere_cache, 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.create_anywhere_cache ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new(parent: parent, anywhere_cache: anywhere_cache, 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.create_anywhere_cache({ parent: parent, anywhere_cache: anywhere_cache, 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.create_anywhere_cache(::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new(parent: parent, anywhere_cache: anywhere_cache, 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, create_anywhere_cache_client_stub.call_rpc_count + end + end + + def test_update_anywhere_cache + # 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. + anywhere_cache = {} + update_mask = {} + request_id = "hello world" + + update_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_anywhere_cache, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::AnywhereCache), request["anywhere_cache"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_anywhere_cache_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_anywhere_cache({ anywhere_cache: anywhere_cache, update_mask: update_mask, 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.update_anywhere_cache anywhere_cache: anywhere_cache, update_mask: update_mask, 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.update_anywhere_cache ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new(anywhere_cache: anywhere_cache, update_mask: update_mask, 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.update_anywhere_cache({ anywhere_cache: anywhere_cache, update_mask: update_mask, 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.update_anywhere_cache(::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new(anywhere_cache: anywhere_cache, update_mask: update_mask, 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, update_anywhere_cache_client_stub.call_rpc_count + end + end + + def test_disable_anywhere_cache + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::AnywhereCache.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" + request_id = "hello world" + + disable_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :disable_anywhere_cache, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, disable_anywhere_cache_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.disable_anywhere_cache({ name: name, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.disable_anywhere_cache name: name, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.disable_anywhere_cache ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new(name: name, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.disable_anywhere_cache({ name: name, 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.disable_anywhere_cache(::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new(name: name, 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, disable_anywhere_cache_client_stub.call_rpc_count + end + end + + def test_pause_anywhere_cache + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::AnywhereCache.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" + request_id = "hello world" + + pause_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :pause_anywhere_cache, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, pause_anywhere_cache_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.pause_anywhere_cache({ name: name, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.pause_anywhere_cache name: name, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.pause_anywhere_cache ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new(name: name, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.pause_anywhere_cache({ name: name, 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.pause_anywhere_cache(::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new(name: name, 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, pause_anywhere_cache_client_stub.call_rpc_count + end + end + + def test_resume_anywhere_cache + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::AnywhereCache.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" + request_id = "hello world" + + resume_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resume_anywhere_cache, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, resume_anywhere_cache_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resume_anywhere_cache({ name: name, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.resume_anywhere_cache name: name, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.resume_anywhere_cache ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new(name: name, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.resume_anywhere_cache({ name: name, 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.resume_anywhere_cache(::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new(name: name, 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, resume_anywhere_cache_client_stub.call_rpc_count + end + end + + def test_get_anywhere_cache + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::AnywhereCache.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" + request_id = "hello world" + + get_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_anywhere_cache, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_anywhere_cache_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_anywhere_cache({ name: name, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_anywhere_cache name: name, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_anywhere_cache ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new(name: name, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_anywhere_cache({ name: name, 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.get_anywhere_cache(::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new(name: name, 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, get_anywhere_cache_client_stub.call_rpc_count + end + end + + def test_list_anywhere_caches + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + request_id = "hello world" + + list_anywhere_caches_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_anywhere_caches, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_anywhere_caches_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_anywhere_caches({ parent: parent, page_size: page_size, page_token: page_token, request_id: request_id }) 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_anywhere_caches parent: parent, page_size: page_size, page_token: page_token, request_id: request_id 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_anywhere_caches ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new(parent: parent, page_size: page_size, page_token: page_token, request_id: request_id) 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_anywhere_caches({ parent: parent, page_size: page_size, page_token: page_token, request_id: request_id }, 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_anywhere_caches(::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new(parent: parent, page_size: page_size, page_token: page_token, request_id: request_id), 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_anywhere_caches_client_stub.call_rpc_count + end + end + + def test_get_project_intelligence_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.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_project_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_project_intelligence_config, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_project_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_project_intelligence_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_project_intelligence_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_project_intelligence_config ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_project_intelligence_config({ 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_project_intelligence_config(::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.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_project_intelligence_config_client_stub.call_rpc_count + end + end + + def test_update_project_intelligence_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.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. + intelligence_config = {} + update_mask = {} + request_id = "hello world" + + update_project_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_project_intelligence_config, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::IntelligenceConfig), request["intelligence_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_project_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_project_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_project_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_project_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_project_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, 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.update_project_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, 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, update_project_intelligence_config_client_stub.call_rpc_count + end + end + + def test_get_folder_intelligence_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.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_folder_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_folder_intelligence_config, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_folder_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_folder_intelligence_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_folder_intelligence_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_folder_intelligence_config ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_folder_intelligence_config({ 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_folder_intelligence_config(::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.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_folder_intelligence_config_client_stub.call_rpc_count + end + end + + def test_update_folder_intelligence_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.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. + intelligence_config = {} + update_mask = {} + request_id = "hello world" + + update_folder_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_folder_intelligence_config, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::IntelligenceConfig), request["intelligence_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_folder_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_folder_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_folder_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_folder_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_folder_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, 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.update_folder_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, 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, update_folder_intelligence_config_client_stub.call_rpc_count + end + end + + def test_get_organization_intelligence_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.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_organization_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_organization_intelligence_config, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_organization_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_organization_intelligence_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_organization_intelligence_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_organization_intelligence_config ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_organization_intelligence_config({ 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_organization_intelligence_config(::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.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_organization_intelligence_config_client_stub.call_rpc_count + end + end + + def test_update_organization_intelligence_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.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. + intelligence_config = {} + update_mask = {} + request_id = "hello world" + + update_organization_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_organization_intelligence_config, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::IntelligenceConfig), request["intelligence_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_organization_intelligence_config_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_organization_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_organization_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_organization_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_organization_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, 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.update_organization_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, 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, update_organization_intelligence_config_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::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::Cloud::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Storage::Control::V2::StorageControl::Client, client + assert_equal creds, client.configure.credentials + end + 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::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Storage::Control::V2::StorageControl::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/helper.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/helper.rb new file mode 100644 index 000000000000..f0e715458fa2 --- /dev/null +++ b/owl-bot-staging/google-cloud-storage-control-v2/test/helper.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "grpc" + +require "ostruct" From cf2a060f7d289a333c4cd0fe1ce3043ca8a8b8c9 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 6 Feb 2026 19:08:41 +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 --- .../.owlbot-manifest.json | 15 +- .../AUTHENTICATION.md | 14 +- google-cloud-storage-control-v2/README.md | 12 +- google-cloud-storage-control-v2/Rakefile | 4 +- .../gapic_metadata.json | 132 +- .../lib/google-cloud-storage-control-v2.rb | 1 - .../control/v2/storage_control/client.rb | 121 + .../lib/google/iam/v1.rb | 43 - .../lib/google/iam/v1/iam_policy.rb | 76 - .../lib/google/iam/v1/iam_policy/client.rb | 711 ---- .../google/iam/v1/iam_policy/credentials.rb | 42 - .../lib/google/iam/v1/iam_policy/rest.rb | 73 - .../google/iam/v1/iam_policy/rest/client.rb | 647 ---- .../iam/v1/iam_policy/rest/service_stub.rb | 265 -- .../lib/google/iam/v1/rest.rb | 35 - .../storage/control/v2/storage_control_pb.rb | 4 +- .../control/v2/storage_control_services_pb.rb | 3 + .../storage/control/v2/storage_control.rb | 36 + .../snippets/iam_policy/get_iam_policy.rb | 47 - .../snippets/iam_policy/set_iam_policy.rb | 47 - .../iam_policy/test_iam_permissions.rb | 47 - .../snippet_metadata_google.iam.v1.json | 135 - ...et_metadata_google.storage.control.v2.json | 40 + .../delete_folder_recursive.rb | 0 .../control/v2/storage_control_test.rb | 71 + .../google/iam/v1/iam_policy_rest_test.rb | 265 -- .../test/google/iam/v1/iam_policy_test.rb | 286 -- .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../google-cloud-storage-control-v2/.toys.rb | 28 - .../google-cloud-storage-control-v2/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-storage-control-v2/Gemfile | 11 - .../LICENSE.md | 201 - .../google-cloud-storage-control-v2/README.md | 154 - .../google-cloud-storage-control-v2/Rakefile | 169 - .../gapic_metadata.json | 153 - .../google-cloud-storage-control-v2.gemspec | 29 - .../lib/google-cloud-storage-control-v2.rb | 21 - .../lib/google/cloud/storage/control/v2.rb | 47 - .../google/cloud/storage/control/v2/rest.rb | 39 - .../storage/control/v2/storage_control.rb | 58 - .../control/v2/storage_control/client.rb | 3379 ----------------- .../control/v2/storage_control/credentials.rb | 53 - .../control/v2/storage_control/operations.rb | 843 ---- .../control/v2/storage_control/paths.rb | 178 - .../control/v2/storage_control/rest.rb | 54 - .../control/v2/storage_control/rest/client.rb | 913 ----- .../v2/storage_control/rest/service_stub.rb | 452 --- .../cloud/storage/control/v2/version.rb | 30 - .../storage/control/v2/storage_control_pb.rb | 107 - .../control/v2/storage_control_services_pb.rb | 125 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 473 --- .../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/api/routing.rb | 459 --- .../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 | 191 - .../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 - .../storage/control/v2/storage_control.rb | 1026 ----- .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - ...et_metadata_google.storage.control.v2.json | 1095 ------ .../storage_control/create_anywhere_cache.rb | 54 - .../snippets/storage_control/create_folder.rb | 47 - .../storage_control/create_managed_folder.rb | 47 - .../snippets/storage_control/delete_folder.rb | 47 - .../storage_control/delete_managed_folder.rb | 47 - .../storage_control/disable_anywhere_cache.rb | 47 - .../storage_control/get_anywhere_cache.rb | 47 - .../snippets/storage_control/get_folder.rb | 47 - .../get_folder_intelligence_config.rb | 47 - .../storage_control/get_iam_policy.rb | 47 - .../storage_control/get_managed_folder.rb | 47 - .../get_organization_intelligence_config.rb | 47 - .../get_project_intelligence_config.rb | 47 - .../storage_control/get_storage_layout.rb | 47 - .../storage_control/list_anywhere_caches.rb | 51 - .../snippets/storage_control/list_folders.rb | 51 - .../storage_control/list_managed_folders.rb | 51 - .../storage_control/pause_anywhere_cache.rb | 47 - .../snippets/storage_control/rename_folder.rb | 54 - .../storage_control/resume_anywhere_cache.rb | 47 - .../storage_control/set_iam_policy.rb | 47 - .../storage_control/test_iam_permissions.rb | 47 - .../storage_control/update_anywhere_cache.rb | 54 - .../update_folder_intelligence_config.rb | 47 - ...update_organization_intelligence_config.rb | 47 - .../update_project_intelligence_config.rb | 47 - .../v2/storage_control_operations_test.rb | 400 -- .../control/v2/storage_control_paths_test.rb | 121 - .../control/v2/storage_control_rest_test.rb | 429 --- .../control/v2/storage_control_test.rb | 1853 --------- .../test/helper.rb | 25 - 106 files changed, 416 insertions(+), 19161 deletions(-) delete mode 100644 google-cloud-storage-control-v2/lib/google/iam/v1.rb delete mode 100644 google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy.rb delete mode 100644 google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/client.rb delete mode 100644 google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/credentials.rb delete mode 100644 google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/rest.rb delete mode 100644 google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/rest/client.rb delete mode 100644 google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/rest/service_stub.rb delete mode 100644 google-cloud-storage-control-v2/lib/google/iam/v1/rest.rb delete mode 100644 google-cloud-storage-control-v2/snippets/iam_policy/get_iam_policy.rb delete mode 100644 google-cloud-storage-control-v2/snippets/iam_policy/set_iam_policy.rb delete mode 100644 google-cloud-storage-control-v2/snippets/iam_policy/test_iam_permissions.rb delete mode 100644 google-cloud-storage-control-v2/snippets/snippet_metadata_google.iam.v1.json rename {owl-bot-staging/google-cloud-storage-control-v2 => google-cloud-storage-control-v2}/snippets/storage_control/delete_folder_recursive.rb (100%) delete mode 100644 google-cloud-storage-control-v2/test/google/iam/v1/iam_policy_rest_test.rb delete mode 100644 google-cloud-storage-control-v2/test/google/iam/v1/iam_policy_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.gitignore delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/.yardopts delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/Gemfile delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/README.md delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/Rakefile delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/google-cloud-storage-control-v2.gemspec delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/rest.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/operations.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/paths.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/version.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/routing.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_anywhere_cache.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_folder.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_managed_folder.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_managed_folder.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/disable_anywhere_cache.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_anywhere_cache.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder_intelligence_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_managed_folder.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_organization_intelligence_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_project_intelligence_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_storage_layout.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_anywhere_caches.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_folders.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_managed_folders.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/pause_anywhere_cache.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/rename_folder.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/resume_anywhere_cache.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_anywhere_cache.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_folder_intelligence_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_organization_intelligence_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_project_intelligence_config.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb delete mode 100644 owl-bot-staging/google-cloud-storage-control-v2/test/helper.rb diff --git a/google-cloud-storage-control-v2/.owlbot-manifest.json b/google-cloud-storage-control-v2/.owlbot-manifest.json index 91ebde47f320..057c05145cc9 100644 --- a/google-cloud-storage-control-v2/.owlbot-manifest.json +++ b/google-cloud-storage-control-v2/.owlbot-manifest.json @@ -25,14 +25,6 @@ "lib/google/cloud/storage/control/v2/storage_control/rest/client.rb", "lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb", "lib/google/cloud/storage/control/v2/version.rb", - "lib/google/iam/v1.rb", - "lib/google/iam/v1/iam_policy.rb", - "lib/google/iam/v1/iam_policy/client.rb", - "lib/google/iam/v1/iam_policy/credentials.rb", - "lib/google/iam/v1/iam_policy/rest.rb", - "lib/google/iam/v1/iam_policy/rest/client.rb", - "lib/google/iam/v1/iam_policy/rest/service_stub.rb", - "lib/google/iam/v1/rest.rb", "lib/google/storage/control/v2/storage_control_pb.rb", "lib/google/storage/control/v2/storage_control_services_pb.rb", "proto_docs/README.md", @@ -55,15 +47,12 @@ "proto_docs/google/storage/control/v2/storage_control.rb", "proto_docs/google/type/expr.rb", "snippets/Gemfile", - "snippets/iam_policy/get_iam_policy.rb", - "snippets/iam_policy/set_iam_policy.rb", - "snippets/iam_policy/test_iam_permissions.rb", - "snippets/snippet_metadata_google.iam.v1.json", "snippets/snippet_metadata_google.storage.control.v2.json", "snippets/storage_control/create_anywhere_cache.rb", "snippets/storage_control/create_folder.rb", "snippets/storage_control/create_managed_folder.rb", "snippets/storage_control/delete_folder.rb", + "snippets/storage_control/delete_folder_recursive.rb", "snippets/storage_control/delete_managed_folder.rb", "snippets/storage_control/disable_anywhere_cache.rb", "snippets/storage_control/get_anywhere_cache.rb", @@ -90,8 +79,6 @@ "test/google/cloud/storage/control/v2/storage_control_paths_test.rb", "test/google/cloud/storage/control/v2/storage_control_rest_test.rb", "test/google/cloud/storage/control/v2/storage_control_test.rb", - "test/google/iam/v1/iam_policy_rest_test.rb", - "test/google/iam/v1/iam_policy_test.rb", "test/helper.rb" ], "static": [ diff --git a/google-cloud-storage-control-v2/AUTHENTICATION.md b/google-cloud-storage-control-v2/AUTHENTICATION.md index 679983eaa3d2..9672b7b75ce0 100644 --- a/google-cloud-storage-control-v2/AUTHENTICATION.md +++ b/google-cloud-storage-control-v2/AUTHENTICATION.md @@ -54,9 +54,9 @@ whenever possible. To configure a credentials file for an individual client initialization: ```ruby -require "google/iam/v1" +require "google/cloud/storage/control/v2" -client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| +client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| config.credentials = "path/to/credentialfile.json" end ``` @@ -64,13 +64,13 @@ end To configure a credentials file globally for all clients: ```ruby -require "google/iam/v1" +require "google/cloud/storage/control/v2" -::Google::Iam::V1::IAMPolicy::Client.configure do |config| +::Google::Cloud::Storage::Control::V2::StorageControl::Client.configure do |config| config.credentials = "path/to/credentialfile.json" end -client = ::Google::Iam::V1::IAMPolicy::Client.new +client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new ``` ### Environment Variables @@ -96,11 +96,11 @@ checks for credentials are: * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file ```ruby -require "google/iam/v1" +require "google/cloud/storage/control/v2" ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -client = ::Google::Iam::V1::IAMPolicy::Client.new +client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new ``` ### Local ADC file diff --git a/google-cloud-storage-control-v2/README.md b/google-cloud-storage-control-v2/README.md index 36af3873d21f..ba465335ff4a 100644 --- a/google-cloud-storage-control-v2/README.md +++ b/google-cloud-storage-control-v2/README.md @@ -30,11 +30,11 @@ In order to use this library, you first need to go through the following steps: ## Quick Start ```ruby -require "google/iam/v1" +require "google/cloud/storage/control/v2" -client = ::Google::Iam::V1::IAMPolicy::Client.new -request = ::Google::Iam::V1::SetIamPolicyRequest.new # (request fields as keyword arguments...) -response = client.set_iam_policy request +client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new +request = ::Google::Cloud::Storage::Control::V2::CreateFolderRequest.new # (request fields as keyword arguments...) +response = client.create_folder request ``` View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-storage-control-v2/latest) @@ -72,10 +72,10 @@ You can customize logging by modifying the `logger` configuration when constructing a client object. For example: ```ruby -require "google/iam/v1" +require "google/cloud/storage/control/v2" require "logger" -client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| +client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| config.logger = Logger.new "my-app.log" end ``` diff --git a/google-cloud-storage-control-v2/Rakefile b/google-cloud-storage-control-v2/Rakefile index 0dba71361fbc..a1cd914a8e7f 100644 --- a/google-cloud-storage-control-v2/Rakefile +++ b/google-cloud-storage-control-v2/Rakefile @@ -57,8 +57,8 @@ task :acceptance, :project, :keyfile do |t, args| 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/iam/v1/iam_policy/credentials" - ::Google::Iam::V1::IAMPolicy::Credentials.env_vars.each do |path| + require "google/cloud/storage/control/v2/storage_control/credentials" + ::Google::Cloud::Storage::Control::V2::StorageControl::Credentials.env_vars.each do |path| ENV[path] = nil end ENV["GOOGLE_CLOUD_PROJECT"] = project diff --git a/google-cloud-storage-control-v2/gapic_metadata.json b/google-cloud-storage-control-v2/gapic_metadata.json index 460f0e3504a4..c36e20575fbc 100644 --- a/google-cloud-storage-control-v2/gapic_metadata.json +++ b/google-cloud-storage-control-v2/gapic_metadata.json @@ -2,17 +2,132 @@ "schema": "1.0", "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", "language": "ruby", - "protoPackage": "google.iam.v1", - "libraryPackage": "::Google::Iam::V1", + "protoPackage": "google.storage.control.v2", + "libraryPackage": "::Google::Cloud::Storage::Control::V2", "services": { - "IAMPolicy": { + "StorageControl": { "clients": { "grpc": { - "libraryClient": "::Google::Iam::V1::IAMPolicy::Client", + "libraryClient": "::Google::Cloud::Storage::Control::V2::StorageControl::Client", "rpcs": { - "SetIamPolicy": { + "CreateFolder": { "methods": [ - "set_iam_policy" + "create_folder" + ] + }, + "DeleteFolder": { + "methods": [ + "delete_folder" + ] + }, + "GetFolder": { + "methods": [ + "get_folder" + ] + }, + "ListFolders": { + "methods": [ + "list_folders" + ] + }, + "RenameFolder": { + "methods": [ + "rename_folder" + ] + }, + "DeleteFolderRecursive": { + "methods": [ + "delete_folder_recursive" + ] + }, + "GetStorageLayout": { + "methods": [ + "get_storage_layout" + ] + }, + "CreateManagedFolder": { + "methods": [ + "create_managed_folder" + ] + }, + "DeleteManagedFolder": { + "methods": [ + "delete_managed_folder" + ] + }, + "GetManagedFolder": { + "methods": [ + "get_managed_folder" + ] + }, + "ListManagedFolders": { + "methods": [ + "list_managed_folders" + ] + }, + "CreateAnywhereCache": { + "methods": [ + "create_anywhere_cache" + ] + }, + "UpdateAnywhereCache": { + "methods": [ + "update_anywhere_cache" + ] + }, + "DisableAnywhereCache": { + "methods": [ + "disable_anywhere_cache" + ] + }, + "PauseAnywhereCache": { + "methods": [ + "pause_anywhere_cache" + ] + }, + "ResumeAnywhereCache": { + "methods": [ + "resume_anywhere_cache" + ] + }, + "GetAnywhereCache": { + "methods": [ + "get_anywhere_cache" + ] + }, + "ListAnywhereCaches": { + "methods": [ + "list_anywhere_caches" + ] + }, + "GetProjectIntelligenceConfig": { + "methods": [ + "get_project_intelligence_config" + ] + }, + "UpdateProjectIntelligenceConfig": { + "methods": [ + "update_project_intelligence_config" + ] + }, + "GetFolderIntelligenceConfig": { + "methods": [ + "get_folder_intelligence_config" + ] + }, + "UpdateFolderIntelligenceConfig": { + "methods": [ + "update_folder_intelligence_config" + ] + }, + "GetOrganizationIntelligenceConfig": { + "methods": [ + "get_organization_intelligence_config" + ] + }, + "UpdateOrganizationIntelligenceConfig": { + "methods": [ + "update_organization_intelligence_config" ] }, "GetIamPolicy": { @@ -20,6 +135,11 @@ "get_iam_policy" ] }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, "TestIamPermissions": { "methods": [ "test_iam_permissions" diff --git a/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb b/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb index 25efa78bcd22..6b73cce6ccbf 100644 --- a/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb +++ b/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb @@ -18,5 +18,4 @@ # This gem does not autoload during Bundler.require. To load this gem, # issue explicit require statements for the packages desired, e.g.: -# require "google/iam/v1" # require "google/cloud/storage/control/v2" diff --git a/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb b/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb index 60f5c2ca68c3..d1604a35aff5 100644 --- a/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb +++ b/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb @@ -93,6 +93,11 @@ def self.configure initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] } + default_config.rpcs.delete_folder_recursive.timeout = 60.0 + default_config.rpcs.delete_folder_recursive.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] + } + default_config.rpcs.get_storage_layout.timeout = 60.0 default_config.rpcs.get_storage_layout.retry_policy = { initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] @@ -834,6 +839,115 @@ def rename_folder request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Deletes a folder recursively. This operation is only applicable to a + # hierarchical namespace enabled bucket. + # + # @overload delete_folder_recursive(request, options = nil) + # Pass arguments to `delete_folder_recursive` via a request object, either of type + # {::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest, ::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_folder_recursive(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) + # Pass arguments to `delete_folder_recursive` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the folder being deleted, however all of its contents + # will be deleted too. Format: + # `projects/{project}/buckets/{bucket}/folders/{folder}` + # @param if_metageneration_match [::Integer] + # Optional. Makes the operation only succeed conditional on whether the root + # folder's current metageneration matches the given value. + # @param if_metageneration_not_match [::Integer] + # Optional. Makes the operation only succeed conditional on whether the root + # folder's current metageneration does not match the given value. + # @param request_id [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + # + # @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/storage/control/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new + # + # # Call the delete_folder_recursive method. + # result = client.delete_folder_recursive 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_folder_recursive request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest + + # 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_folder_recursive.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::Storage::Control::V2::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 + regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name + if regex_match + header_params["bucket"] = regex_match["bucket".to_s] + end + end + + request_params_header = URI.encode_www_form header_params + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_folder_recursive.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_folder_recursive.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @storage_control_stub.call_rpc :delete_folder_recursive, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Returns the storage layout configuration for a given bucket. # @@ -3085,6 +3199,11 @@ class Rpcs # attr_reader :rename_folder ## + # RPC-specific configuration for `delete_folder_recursive` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_folder_recursive + ## # RPC-specific configuration for `get_storage_layout` # @return [::Gapic::Config::Method] # @@ -3202,6 +3321,8 @@ def initialize parent_rpcs = nil @list_folders = ::Gapic::Config::Method.new list_folders_config rename_folder_config = parent_rpcs.rename_folder if parent_rpcs.respond_to? :rename_folder @rename_folder = ::Gapic::Config::Method.new rename_folder_config + delete_folder_recursive_config = parent_rpcs.delete_folder_recursive if parent_rpcs.respond_to? :delete_folder_recursive + @delete_folder_recursive = ::Gapic::Config::Method.new delete_folder_recursive_config get_storage_layout_config = parent_rpcs.get_storage_layout if parent_rpcs.respond_to? :get_storage_layout @get_storage_layout = ::Gapic::Config::Method.new get_storage_layout_config create_managed_folder_config = parent_rpcs.create_managed_folder if parent_rpcs.respond_to? :create_managed_folder diff --git a/google-cloud-storage-control-v2/lib/google/iam/v1.rb b/google-cloud-storage-control-v2/lib/google/iam/v1.rb deleted file mode 100644 index 79112374d084..000000000000 --- a/google-cloud-storage-control-v2/lib/google/iam/v1.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/iam/v1/iam_policy" -require "google/cloud/storage/control/v2/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/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy.rb b/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy.rb deleted file mode 100644 index 17451c8db9d4..000000000000 --- a/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,76 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/storage/control/v2/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/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/client.rb b/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/client.rb deleted file mode 100644 index 85db63c16a49..000000000000 --- a/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/client.rb +++ /dev/null @@ -1,711 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/iam/v1/iam_policy_pb" - -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, - logger: @config.logger - ) - - @iam_policy_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @iam_policy_stub.logger - end - - # 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::Storage::Control::V2::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? - 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::Storage::Control::V2::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? - 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::Storage::Control::V2::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? - 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: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/credentials.rb b/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/credentials.rb deleted file mode 100644 index 58c18d8376c1..000000000000 --- a/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/credentials.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module 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/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/rest.rb b/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/rest.rb deleted file mode 100644 index 4f0d40e0777d..000000000000 --- a/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/rest.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/storage/control/v2/version" - -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/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/rest/client.rb b/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/rest/client.rb deleted file mode 100644 index f88b5269f95e..000000000000 --- a/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/rest/client.rb +++ /dev/null @@ -1,647 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/iam/v1/iam_policy_pb" -require "google/iam/v1/iam_policy/rest/service_stub" - -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, - logger: @config.logger - ) - - @iam_policy_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @iam_policy_stub.logger - end - - # 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::Storage::Control::V2::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? - 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::Storage::Control::V2::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? - 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::Storage::Control::V2::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? - 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 - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "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, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the 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/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/rest/service_stub.rb b/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/rest/service_stub.rb deleted file mode 100644 index 94e9f4648bb0..000000000000 --- a/google-cloud-storage-control-v2/lib/google/iam/v1/iam_policy/rest/service_stub.rb +++ /dev/null @@ -1,265 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/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 - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @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/google-cloud-storage-control-v2/lib/google/iam/v1/rest.rb b/google-cloud-storage-control-v2/lib/google/iam/v1/rest.rb deleted file mode 100644 index 2d136ea8c5a2..000000000000 --- a/google-cloud-storage-control-v2/lib/google/iam/v1/rest.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/iam/v1/iam_policy/rest" -require "google/cloud/storage/control/v2/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/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb b/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb index 640c4ab7f2b8..13efa67f3d74 100644 --- a/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb +++ b/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb @@ -19,7 +19,7 @@ require 'google/protobuf/timestamp_pb' -descriptor_data = "\n/google/storage/control/v2/storage_control.proto\x12\x19google.storage.control.v2\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\x18google/api/routing.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"+\n\x11PendingRenameInfo\x12\x16\n\toperation\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\xe2\x02\n\x06\x46older\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0emetageneration\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12N\n\x13pending_rename_info\x18\x07 \x01(\x0b\x32,.google.storage.control.v2.PendingRenameInfoB\x03\xe0\x41\x03:l\xea\x41i\n\x1dstorage.googleapis.com/Folder\x12\x37projects/{project}/buckets/{bucket}/folders/{folder=**}*\x07\x66olders2\x06\x66older\"\xf4\x01\n\x10GetFolderRequest\x12\x33\n\x04name\x18\x06 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xd5\x01\n\x13\x43reateFolderRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dstorage.googleapis.com/Folder\x12\x36\n\x06\x66older\x18\x02 \x01(\x0b\x32!.google.storage.control.v2.FolderB\x03\xe0\x41\x02\x12\x16\n\tfolder_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\trecursive\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xf7\x01\n\x13\x44\x65leteFolderRequest\x12\x33\n\x04name\x18\x06 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x8c\x02\n\x12ListFoldersRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dstorage.googleapis.com/Folder\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06prefix\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tdelimiter\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13lexicographic_start\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11lexicographic_end\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\t \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"b\n\x13ListFoldersResponse\x12\x32\n\x07\x66olders\x18\x01 \x03(\x0b\x32!.google.storage.control.v2.Folder\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9b\x02\n\x13RenameFolderRequest\x12\x33\n\x04name\x18\x07 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12\"\n\x15\x64\x65stination_folder_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12$\n\x17if_metageneration_match\x18\x04 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x05 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x06 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x9a\x02\n\"CommonLongRunningOperationMetadata\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\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04type\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1d\n\x10progress_percent\x18\x06 \x01(\x05\x42\x03\xe0\x41\x03\"\xa7\x01\n\x14RenameFolderMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x18\n\x10source_folder_id\x18\x02 \x01(\t\x12\x1d\n\x15\x64\x65stination_folder_id\x18\x03 \x01(\t\"\xf8\x03\n\rStorageLayout\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08location\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rlocation_type\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x64\n\x17\x63ustom_placement_config\x18\x04 \x01(\x0b\x32>.google.storage.control.v2.StorageLayout.CustomPlacementConfigB\x03\xe0\x41\x03\x12\x63\n\x16hierarchical_namespace\x18\x05 \x01(\x0b\x32>.google.storage.control.v2.StorageLayout.HierarchicalNamespaceB\x03\xe0\x41\x03\x1a/\n\x15\x43ustomPlacementConfig\x12\x16\n\x0e\x64\x61ta_locations\x18\x01 \x03(\t\x1a(\n\x15HierarchicalNamespace\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08:{\xea\x41x\n$storage.googleapis.com/StorageLayout\x12\x31projects/{project}/buckets/{bucket}/storageLayout*\x0estorageLayouts2\rstorageLayout\"\x86\x01\n\x17GetStorageLayoutRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/StorageLayout\x12\x0e\n\x06prefix\x18\x02 \x01(\t\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xbf\x02\n\rManagedFolder\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0emetageneration\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\x91\x01\xea\x41\x8d\x01\n$storage.googleapis.com/ManagedFolder\x12\x46projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}*\x0emanagedFolders2\rmanagedFolder\"\x82\x02\n\x17GetManagedFolderRequest\x12:\n\x04name\x18\x06 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/ManagedFolder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xe2\x01\n\x1a\x43reateManagedFolderRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/ManagedFolder\x12\x45\n\x0emanaged_folder\x18\x02 \x01(\x0b\x32(.google.storage.control.v2.ManagedFolderB\x03\xe0\x41\x02\x12\x1e\n\x11managed_folder_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x9e\x02\n\x1a\x44\x65leteManagedFolderRequest\x12:\n\x04name\x18\x07 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/ManagedFolder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x17\n\x0f\x61llow_non_empty\x18\x05 \x01(\x08\x12\x1f\n\nrequest_id\x18\x06 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xc0\x01\n\x19ListManagedFoldersRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/ManagedFolder\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06prefix\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x1aListManagedFoldersResponse\x12\x41\n\x0fmanaged_folders\x18\x01 \x03(\x0b\x32(.google.storage.control.v2.ManagedFolder\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb0\x02\n\x1b\x43reateAnywhereCacheMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x1e\n\x11\x61nywhere_cache_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04zone\x18\x06 \x01(\tH\x01\x88\x01\x01\x12+\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x02\x88\x01\x01\x12\x1d\n\x10\x61\x64mission_policy\x18\x05 \x01(\tH\x03\x88\x01\x01\x42\x14\n\x12_anywhere_cache_idB\x07\n\x05_zoneB\x06\n\x04_ttlB\x13\n\x11_admission_policy\"\xb0\x02\n\x1bUpdateAnywhereCacheMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x1e\n\x11\x61nywhere_cache_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04zone\x18\x05 \x01(\tH\x01\x88\x01\x01\x12+\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x02\x88\x01\x01\x12\x1d\n\x10\x61\x64mission_policy\x18\x04 \x01(\tH\x03\x88\x01\x01\x42\x14\n\x12_anywhere_cache_idB\x07\n\x05_zoneB\x06\n\x04_ttlB\x13\n\x11_admission_policy\"\xa5\x03\n\rAnywhereCache\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x11\n\x04zone\x18\n \x01(\tB\x03\xe0\x41\x05\x12&\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x18\n\x10\x61\x64mission_policy\x18\t \x01(\t\x12\x12\n\x05state\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0epending_update\x18\x08 \x01(\x08\x42\x03\xe0\x41\x03:\x8e\x01\xea\x41\x8a\x01\n$storage.googleapis.com/AnywhereCache\x12\x43projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}*\x0e\x61nywhereCaches2\ranywhereCache\"\xc2\x01\n\x1a\x43reateAnywhereCacheRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/AnywhereCache\x12\x45\n\x0e\x61nywhere_cache\x18\x03 \x01(\x0b\x32(.google.storage.control.v2.AnywhereCacheB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xba\x01\n\x1aUpdateAnywhereCacheRequest\x12\x45\n\x0e\x61nywhere_cache\x18\x01 \x01(\x0b\x32(.google.storage.control.v2.AnywhereCacheB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"z\n\x1b\x44isableAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x19PauseAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"y\n\x1aResumeAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"v\n\x17GetAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xa1\x01\n\x19ListAnywhereCachesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/AnywhereCache\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x1aListAnywhereCachesResponse\x12\x41\n\x0f\x61nywhere_caches\x18\x01 \x03(\x0b\x32(.google.storage.control.v2.AnywhereCache\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8e\x0e\n\x12IntelligenceConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12X\n\x0e\x65\x64ition_config\x18\x02 \x01(\x0e\x32;.google.storage.control.v2.IntelligenceConfig.EditionConfigB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12I\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x34.google.storage.control.v2.IntelligenceConfig.FilterB\x03\xe0\x41\x01\x12u\n\x1d\x65\x66\x66\x65\x63tive_intelligence_config\x18\x05 \x01(\x0b\x32I.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfigB\x03\xe0\x41\x03\x12O\n\x0ctrial_config\x18\x07 \x01(\x0b\x32\x39.google.storage.control.v2.IntelligenceConfig.TrialConfig\x1a\xfc\x04\n\x06\x46ilter\x12v\n included_cloud_storage_locations\x18\x01 \x01(\x0b\x32J.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocationsH\x00\x12v\n excluded_cloud_storage_locations\x18\x02 \x01(\x0b\x32J.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocationsH\x00\x12r\n\x1eincluded_cloud_storage_buckets\x18\x03 \x01(\x0b\x32H.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBucketsH\x01\x12r\n\x1e\x65xcluded_cloud_storage_buckets\x18\x04 \x01(\x0b\x32H.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBucketsH\x01\x1a/\n\x15\x43loudStorageLocations\x12\x16\n\tlocations\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a\x35\n\x13\x43loudStorageBuckets\x12\x1e\n\x11\x62ucket_id_regexes\x18\x01 \x03(\tB\x03\xe0\x41\x01\x42\x19\n\x17\x63loud_storage_locationsB\x17\n\x15\x63loud_storage_buckets\x1a\x8a\x02\n\x1b\x45\x66\x66\x65\x63tiveIntelligenceConfig\x12z\n\x11\x65\x66\x66\x65\x63tive_edition\x18\x01 \x01(\x0e\x32Z.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEditionB\x03\xe0\x41\x03\x12 \n\x13intelligence_config\x18\x02 \x01(\tB\x03\xe0\x41\x03\"M\n\x10\x45\x66\x66\x65\x63tiveEdition\x12!\n\x1d\x45\x46\x46\x45\x43TIVE_EDITION_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0c\n\x08STANDARD\x10\x02\x1a\x43\n\x0bTrialConfig\x12\x34\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"c\n\rEditionConfig\x12\x1e\n\x1a\x45\x44ITION_CONFIG_UNSPECIFIED\x10\x00\x12\x0b\n\x07INHERIT\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\x0c\n\x08STANDARD\x10\x03\x12\t\n\x05TRIAL\x10\x05:\x8b\x02\xea\x41\x87\x02\n)storage.googleapis.com/IntelligenceConfig\x12\x38\x66olders/{folder}/locations/{location}/intelligenceConfig\x12;organizations/{org}/locations/{location}/intelligenceConfig\x12:projects/{project}/locations/{location}/intelligenceConfig*\x13intelligenceConfigs2\x12intelligenceConfig\"\xd5\x01\n+UpdateOrganizationIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xcf\x01\n%UpdateFolderIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xd0\x01\n&UpdateProjectIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"k\n(GetOrganizationIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig\"e\n\"GetFolderIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig\"f\n#GetProjectIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig2\xee*\n\x0eStorageControl\x12\x9a\x01\n\x0c\x43reateFolder\x12..google.storage.control.v2.CreateFolderRequest\x1a!.google.storage.control.v2.Folder\"7\xda\x41\x17parent,folder,folder_id\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\x8f\x01\n\x0c\x44\x65leteFolder\x12..google.storage.control.v2.DeleteFolderRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\x94\x01\n\tGetFolder\x12+.google.storage.control.v2.GetFolderRequest\x1a!.google.storage.control.v2.Folder\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\x94\x01\n\x0bListFolders\x12-.google.storage.control.v2.ListFoldersRequest\x1a..google.storage.control.v2.ListFoldersResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xcd\x01\n\x0cRenameFolder\x12..google.storage.control.v2.RenameFolderRequest\x1a\x1d.google.longrunning.Operation\"n\xca\x41\x1e\n\x06\x46older\x12\x14RenameFolderMetadata\xda\x41\x1aname,destination_folder_id\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetStorageLayout\x12\x32.google.storage.control.v2.GetStorageLayoutRequest\x1a(.google.storage.control.v2.StorageLayout\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xbf\x01\n\x13\x43reateManagedFolder\x12\x35.google.storage.control.v2.CreateManagedFolderRequest\x1a(.google.storage.control.v2.ManagedFolder\"G\xda\x41\'parent,managed_folder,managed_folder_id\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\x9d\x01\n\x13\x44\x65leteManagedFolder\x12\x35.google.storage.control.v2.DeleteManagedFolderRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetManagedFolder\x12\x32.google.storage.control.v2.GetManagedFolderRequest\x1a(.google.storage.control.v2.ManagedFolder\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x12ListManagedFolders\x12\x34.google.storage.control.v2.ListManagedFoldersRequest\x1a\x35.google.storage.control.v2.ListManagedFoldersResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xd1\x01\n\x13\x43reateAnywhereCache\x12\x35.google.storage.control.v2.CreateAnywhereCacheRequest\x1a\x1d.google.longrunning.Operation\"d\xca\x41,\n\rAnywhereCache\x12\x1b\x43reateAnywhereCacheMetadata\xda\x41\x15parent,anywhere_cache\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xf9\x01\n\x13UpdateAnywhereCache\x12\x35.google.storage.control.v2.UpdateAnywhereCacheRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41,\n\rAnywhereCache\x12\x1bUpdateAnywhereCacheMetadata\xda\x41\x1a\x61nywhere_cache,update_mask\x8a\xd3\xe4\x93\x02\x39\x12\x37\n\x13\x61nywhere_cache.name\x12 {bucket=projects/*/buckets/*}/**\x12\xb1\x01\n\x14\x44isableAnywhereCache\x12\x36.google.storage.control.v2.DisableAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xad\x01\n\x12PauseAnywhereCache\x12\x34.google.storage.control.v2.PauseAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xaf\x01\n\x13ResumeAnywhereCache\x12\x35.google.storage.control.v2.ResumeAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetAnywhereCache\x12\x32.google.storage.control.v2.GetAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x12ListAnywhereCaches\x12\x34.google.storage.control.v2.ListAnywhereCachesRequest\x1a\x35.google.storage.control.v2.ListAnywhereCachesResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xd2\x01\n\x1cGetProjectIntelligenceConfig\x12>.google.storage.control.v2.GetProjectIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v2/{name=projects/*/locations/*/intelligenceConfig}\x12\x9d\x02\n\x1fUpdateProjectIntelligenceConfig\x12\x41.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x87\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02_2H/v2/{intelligence_config.name=projects/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xcf\x01\n\x1bGetFolderIntelligenceConfig\x12=.google.storage.control.v2.GetFolderIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v2/{name=folders/*/locations/*/intelligenceConfig}\x12\x9a\x02\n\x1eUpdateFolderIntelligenceConfig\x12@.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x86\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02^2G/v2/{intelligence_config.name=folders/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xe1\x01\n!GetOrganizationIntelligenceConfig\x12\x43.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v2/{name=organizations/*/locations/*/intelligenceConfig}\x12\xac\x02\n$UpdateOrganizationIntelligenceConfig\x12\x46.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x8c\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02\x64\x32M/v2/{intelligence_config.name=organizations/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xa3\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"X\xda\x41\x08resource\x8a\xd3\xe4\x93\x02G\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12,\n\x08resource\x12 {bucket=projects/*/buckets/*}/**\x12\xaa\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"_\xda\x41\x0fresource,policy\x8a\xd3\xe4\x93\x02G\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12,\n\x08resource\x12 {bucket=projects/*/buckets/*}/**\x12\x96\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\xaa\x01\xda\x41\x14resource,permissions\x8a\xd3\xe4\x93\x02\x8c\x01\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12\x34\n\x08resource\x12({bucket=projects/*/buckets/*}/objects/**\x12;\n\x08resource\x12/{bucket=projects/*/buckets/*}/managedFolders/**\x1a\xa7\x02\xca\x41\x16storage.googleapis.com\xd2\x41\x8a\x02https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/devstorage.full_control,https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/devstorage.read_writeB\xa6\x02\n\x1d\x63om.google.storage.control.v2B\x13StorageControlProtoP\x01Z=cloud.google.com/go/storage/control/apiv2/controlpb;controlpb\xaa\x02\x1fGoogle.Cloud.Storage.Control.V2\xca\x02\x1fGoogle\\Cloud\\Storage\\Control\\V2\xea\x02#Google::Cloud::Storage::Control::V2\xea\x41\x44\n\x1dstorage.googleapis.com/Bucket\x12#projects/{project}/buckets/{bucket}b\x06proto3" +descriptor_data = "\n/google/storage/control/v2/storage_control.proto\x12\x19google.storage.control.v2\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\x18google/api/routing.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"+\n\x11PendingRenameInfo\x12\x16\n\toperation\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\xe2\x02\n\x06\x46older\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0emetageneration\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12N\n\x13pending_rename_info\x18\x07 \x01(\x0b\x32,.google.storage.control.v2.PendingRenameInfoB\x03\xe0\x41\x03:l\xea\x41i\n\x1dstorage.googleapis.com/Folder\x12\x37projects/{project}/buckets/{bucket}/folders/{folder=**}*\x07\x66olders2\x06\x66older\"\xf4\x01\n\x10GetFolderRequest\x12\x33\n\x04name\x18\x06 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xd5\x01\n\x13\x43reateFolderRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dstorage.googleapis.com/Folder\x12\x36\n\x06\x66older\x18\x02 \x01(\x0b\x32!.google.storage.control.v2.FolderB\x03\xe0\x41\x02\x12\x16\n\tfolder_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\trecursive\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xf7\x01\n\x13\x44\x65leteFolderRequest\x12\x33\n\x04name\x18\x06 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x8c\x02\n\x12ListFoldersRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dstorage.googleapis.com/Folder\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06prefix\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tdelimiter\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13lexicographic_start\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11lexicographic_end\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\t \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"b\n\x13ListFoldersResponse\x12\x32\n\x07\x66olders\x18\x01 \x03(\x0b\x32!.google.storage.control.v2.Folder\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9b\x02\n\x13RenameFolderRequest\x12\x33\n\x04name\x18\x07 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12\"\n\x15\x64\x65stination_folder_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12$\n\x17if_metageneration_match\x18\x04 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x05 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x06 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x8a\x02\n\x1c\x44\x65leteFolderRecursiveRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12)\n\x17if_metageneration_match\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12-\n\x1bif_metageneration_not_match\x18\x03 \x01(\x03\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x9a\x02\n\"CommonLongRunningOperationMetadata\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\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04type\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1d\n\x10progress_percent\x18\x06 \x01(\x05\x42\x03\xe0\x41\x03\"\xa7\x01\n\x14RenameFolderMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x18\n\x10source_folder_id\x18\x02 \x01(\t\x12\x1d\n\x15\x64\x65stination_folder_id\x18\x03 \x01(\t\"\x8a\x01\n\x1d\x44\x65leteFolderRecursiveMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x11\n\tfolder_id\x18\x02 \x01(\t\"\xf8\x03\n\rStorageLayout\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08location\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rlocation_type\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x64\n\x17\x63ustom_placement_config\x18\x04 \x01(\x0b\x32>.google.storage.control.v2.StorageLayout.CustomPlacementConfigB\x03\xe0\x41\x03\x12\x63\n\x16hierarchical_namespace\x18\x05 \x01(\x0b\x32>.google.storage.control.v2.StorageLayout.HierarchicalNamespaceB\x03\xe0\x41\x03\x1a/\n\x15\x43ustomPlacementConfig\x12\x16\n\x0e\x64\x61ta_locations\x18\x01 \x03(\t\x1a(\n\x15HierarchicalNamespace\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08:{\xea\x41x\n$storage.googleapis.com/StorageLayout\x12\x31projects/{project}/buckets/{bucket}/storageLayout*\x0estorageLayouts2\rstorageLayout\"\x86\x01\n\x17GetStorageLayoutRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/StorageLayout\x12\x0e\n\x06prefix\x18\x02 \x01(\t\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xbf\x02\n\rManagedFolder\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0emetageneration\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\x91\x01\xea\x41\x8d\x01\n$storage.googleapis.com/ManagedFolder\x12\x46projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}*\x0emanagedFolders2\rmanagedFolder\"\x82\x02\n\x17GetManagedFolderRequest\x12:\n\x04name\x18\x06 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/ManagedFolder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xe2\x01\n\x1a\x43reateManagedFolderRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/ManagedFolder\x12\x45\n\x0emanaged_folder\x18\x02 \x01(\x0b\x32(.google.storage.control.v2.ManagedFolderB\x03\xe0\x41\x02\x12\x1e\n\x11managed_folder_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x9e\x02\n\x1a\x44\x65leteManagedFolderRequest\x12:\n\x04name\x18\x07 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/ManagedFolder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x17\n\x0f\x61llow_non_empty\x18\x05 \x01(\x08\x12\x1f\n\nrequest_id\x18\x06 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xc0\x01\n\x19ListManagedFoldersRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/ManagedFolder\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06prefix\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x1aListManagedFoldersResponse\x12\x41\n\x0fmanaged_folders\x18\x01 \x03(\x0b\x32(.google.storage.control.v2.ManagedFolder\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb0\x02\n\x1b\x43reateAnywhereCacheMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x1e\n\x11\x61nywhere_cache_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04zone\x18\x06 \x01(\tH\x01\x88\x01\x01\x12+\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x02\x88\x01\x01\x12\x1d\n\x10\x61\x64mission_policy\x18\x05 \x01(\tH\x03\x88\x01\x01\x42\x14\n\x12_anywhere_cache_idB\x07\n\x05_zoneB\x06\n\x04_ttlB\x13\n\x11_admission_policy\"\xb0\x02\n\x1bUpdateAnywhereCacheMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x1e\n\x11\x61nywhere_cache_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04zone\x18\x05 \x01(\tH\x01\x88\x01\x01\x12+\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x02\x88\x01\x01\x12\x1d\n\x10\x61\x64mission_policy\x18\x04 \x01(\tH\x03\x88\x01\x01\x42\x14\n\x12_anywhere_cache_idB\x07\n\x05_zoneB\x06\n\x04_ttlB\x13\n\x11_admission_policy\"\xa5\x03\n\rAnywhereCache\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x11\n\x04zone\x18\n \x01(\tB\x03\xe0\x41\x05\x12&\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x18\n\x10\x61\x64mission_policy\x18\t \x01(\t\x12\x12\n\x05state\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0epending_update\x18\x08 \x01(\x08\x42\x03\xe0\x41\x03:\x8e\x01\xea\x41\x8a\x01\n$storage.googleapis.com/AnywhereCache\x12\x43projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}*\x0e\x61nywhereCaches2\ranywhereCache\"\xc2\x01\n\x1a\x43reateAnywhereCacheRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/AnywhereCache\x12\x45\n\x0e\x61nywhere_cache\x18\x03 \x01(\x0b\x32(.google.storage.control.v2.AnywhereCacheB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xba\x01\n\x1aUpdateAnywhereCacheRequest\x12\x45\n\x0e\x61nywhere_cache\x18\x01 \x01(\x0b\x32(.google.storage.control.v2.AnywhereCacheB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"z\n\x1b\x44isableAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x19PauseAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"y\n\x1aResumeAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"v\n\x17GetAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xa1\x01\n\x19ListAnywhereCachesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/AnywhereCache\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x1aListAnywhereCachesResponse\x12\x41\n\x0f\x61nywhere_caches\x18\x01 \x03(\x0b\x32(.google.storage.control.v2.AnywhereCache\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8e\x0e\n\x12IntelligenceConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12X\n\x0e\x65\x64ition_config\x18\x02 \x01(\x0e\x32;.google.storage.control.v2.IntelligenceConfig.EditionConfigB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12I\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x34.google.storage.control.v2.IntelligenceConfig.FilterB\x03\xe0\x41\x01\x12u\n\x1d\x65\x66\x66\x65\x63tive_intelligence_config\x18\x05 \x01(\x0b\x32I.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfigB\x03\xe0\x41\x03\x12O\n\x0ctrial_config\x18\x07 \x01(\x0b\x32\x39.google.storage.control.v2.IntelligenceConfig.TrialConfig\x1a\xfc\x04\n\x06\x46ilter\x12v\n included_cloud_storage_locations\x18\x01 \x01(\x0b\x32J.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocationsH\x00\x12v\n excluded_cloud_storage_locations\x18\x02 \x01(\x0b\x32J.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocationsH\x00\x12r\n\x1eincluded_cloud_storage_buckets\x18\x03 \x01(\x0b\x32H.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBucketsH\x01\x12r\n\x1e\x65xcluded_cloud_storage_buckets\x18\x04 \x01(\x0b\x32H.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBucketsH\x01\x1a/\n\x15\x43loudStorageLocations\x12\x16\n\tlocations\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a\x35\n\x13\x43loudStorageBuckets\x12\x1e\n\x11\x62ucket_id_regexes\x18\x01 \x03(\tB\x03\xe0\x41\x01\x42\x19\n\x17\x63loud_storage_locationsB\x17\n\x15\x63loud_storage_buckets\x1a\x8a\x02\n\x1b\x45\x66\x66\x65\x63tiveIntelligenceConfig\x12z\n\x11\x65\x66\x66\x65\x63tive_edition\x18\x01 \x01(\x0e\x32Z.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEditionB\x03\xe0\x41\x03\x12 \n\x13intelligence_config\x18\x02 \x01(\tB\x03\xe0\x41\x03\"M\n\x10\x45\x66\x66\x65\x63tiveEdition\x12!\n\x1d\x45\x46\x46\x45\x43TIVE_EDITION_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0c\n\x08STANDARD\x10\x02\x1a\x43\n\x0bTrialConfig\x12\x34\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"c\n\rEditionConfig\x12\x1e\n\x1a\x45\x44ITION_CONFIG_UNSPECIFIED\x10\x00\x12\x0b\n\x07INHERIT\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\x0c\n\x08STANDARD\x10\x03\x12\t\n\x05TRIAL\x10\x05:\x8b\x02\xea\x41\x87\x02\n)storage.googleapis.com/IntelligenceConfig\x12\x38\x66olders/{folder}/locations/{location}/intelligenceConfig\x12;organizations/{org}/locations/{location}/intelligenceConfig\x12:projects/{project}/locations/{location}/intelligenceConfig*\x13intelligenceConfigs2\x12intelligenceConfig\"\xd5\x01\n+UpdateOrganizationIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xcf\x01\n%UpdateFolderIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xd0\x01\n&UpdateProjectIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"k\n(GetOrganizationIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig\"e\n\"GetFolderIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig\"f\n#GetProjectIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig2\xd2,\n\x0eStorageControl\x12\x9a\x01\n\x0c\x43reateFolder\x12..google.storage.control.v2.CreateFolderRequest\x1a!.google.storage.control.v2.Folder\"7\xda\x41\x17parent,folder,folder_id\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\x8f\x01\n\x0c\x44\x65leteFolder\x12..google.storage.control.v2.DeleteFolderRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\x94\x01\n\tGetFolder\x12+.google.storage.control.v2.GetFolderRequest\x1a!.google.storage.control.v2.Folder\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\x94\x01\n\x0bListFolders\x12-.google.storage.control.v2.ListFoldersRequest\x1a..google.storage.control.v2.ListFoldersResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xcd\x01\n\x0cRenameFolder\x12..google.storage.control.v2.RenameFolderRequest\x1a\x1d.google.longrunning.Operation\"n\xca\x41\x1e\n\x06\x46older\x12\x14RenameFolderMetadata\xda\x41\x1aname,destination_folder_id\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xe1\x01\n\x15\x44\x65leteFolderRecursive\x12\x37.google.storage.control.v2.DeleteFolderRecursiveRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x36\n\x15google.protobuf.Empty\x12\x1d\x44\x65leteFolderRecursiveMetadata\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetStorageLayout\x12\x32.google.storage.control.v2.GetStorageLayoutRequest\x1a(.google.storage.control.v2.StorageLayout\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xbf\x01\n\x13\x43reateManagedFolder\x12\x35.google.storage.control.v2.CreateManagedFolderRequest\x1a(.google.storage.control.v2.ManagedFolder\"G\xda\x41\'parent,managed_folder,managed_folder_id\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\x9d\x01\n\x13\x44\x65leteManagedFolder\x12\x35.google.storage.control.v2.DeleteManagedFolderRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetManagedFolder\x12\x32.google.storage.control.v2.GetManagedFolderRequest\x1a(.google.storage.control.v2.ManagedFolder\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x12ListManagedFolders\x12\x34.google.storage.control.v2.ListManagedFoldersRequest\x1a\x35.google.storage.control.v2.ListManagedFoldersResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xd1\x01\n\x13\x43reateAnywhereCache\x12\x35.google.storage.control.v2.CreateAnywhereCacheRequest\x1a\x1d.google.longrunning.Operation\"d\xca\x41,\n\rAnywhereCache\x12\x1b\x43reateAnywhereCacheMetadata\xda\x41\x15parent,anywhere_cache\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xf9\x01\n\x13UpdateAnywhereCache\x12\x35.google.storage.control.v2.UpdateAnywhereCacheRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41,\n\rAnywhereCache\x12\x1bUpdateAnywhereCacheMetadata\xda\x41\x1a\x61nywhere_cache,update_mask\x8a\xd3\xe4\x93\x02\x39\x12\x37\n\x13\x61nywhere_cache.name\x12 {bucket=projects/*/buckets/*}/**\x12\xb1\x01\n\x14\x44isableAnywhereCache\x12\x36.google.storage.control.v2.DisableAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xad\x01\n\x12PauseAnywhereCache\x12\x34.google.storage.control.v2.PauseAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xaf\x01\n\x13ResumeAnywhereCache\x12\x35.google.storage.control.v2.ResumeAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetAnywhereCache\x12\x32.google.storage.control.v2.GetAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x12ListAnywhereCaches\x12\x34.google.storage.control.v2.ListAnywhereCachesRequest\x1a\x35.google.storage.control.v2.ListAnywhereCachesResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xd2\x01\n\x1cGetProjectIntelligenceConfig\x12>.google.storage.control.v2.GetProjectIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v2/{name=projects/*/locations/*/intelligenceConfig}\x12\x9d\x02\n\x1fUpdateProjectIntelligenceConfig\x12\x41.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x87\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02_2H/v2/{intelligence_config.name=projects/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xcf\x01\n\x1bGetFolderIntelligenceConfig\x12=.google.storage.control.v2.GetFolderIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v2/{name=folders/*/locations/*/intelligenceConfig}\x12\x9a\x02\n\x1eUpdateFolderIntelligenceConfig\x12@.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x86\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02^2G/v2/{intelligence_config.name=folders/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xe1\x01\n!GetOrganizationIntelligenceConfig\x12\x43.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v2/{name=organizations/*/locations/*/intelligenceConfig}\x12\xac\x02\n$UpdateOrganizationIntelligenceConfig\x12\x46.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x8c\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02\x64\x32M/v2/{intelligence_config.name=organizations/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xa3\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"X\xda\x41\x08resource\x8a\xd3\xe4\x93\x02G\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12,\n\x08resource\x12 {bucket=projects/*/buckets/*}/**\x12\xaa\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"_\xda\x41\x0fresource,policy\x8a\xd3\xe4\x93\x02G\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12,\n\x08resource\x12 {bucket=projects/*/buckets/*}/**\x12\x96\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\xaa\x01\xda\x41\x14resource,permissions\x8a\xd3\xe4\x93\x02\x8c\x01\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12\x34\n\x08resource\x12({bucket=projects/*/buckets/*}/objects/**\x12;\n\x08resource\x12/{bucket=projects/*/buckets/*}/managedFolders/**\x1a\xa7\x02\xca\x41\x16storage.googleapis.com\xd2\x41\x8a\x02https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/devstorage.full_control,https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/devstorage.read_writeB\xa6\x02\n\x1d\x63om.google.storage.control.v2B\x13StorageControlProtoP\x01Z=cloud.google.com/go/storage/control/apiv2/controlpb;controlpb\xaa\x02\x1fGoogle.Cloud.Storage.Control.V2\xca\x02\x1fGoogle\\Cloud\\Storage\\Control\\V2\xea\x02#Google::Cloud::Storage::Control::V2\xea\x41\x44\n\x1dstorage.googleapis.com/Bucket\x12#projects/{project}/buckets/{bucket}b\x06proto3" pool = Google::Protobuf::DescriptorPool.generated_pool @@ -61,8 +61,10 @@ module V2 ListFoldersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListFoldersRequest").msgclass ListFoldersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListFoldersResponse").msgclass RenameFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.RenameFolderRequest").msgclass + DeleteFolderRecursiveRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteFolderRecursiveRequest").msgclass CommonLongRunningOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CommonLongRunningOperationMetadata").msgclass RenameFolderMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.RenameFolderMetadata").msgclass + DeleteFolderRecursiveMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteFolderRecursiveMetadata").msgclass StorageLayout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.StorageLayout").msgclass StorageLayout::CustomPlacementConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.StorageLayout.CustomPlacementConfig").msgclass StorageLayout::HierarchicalNamespace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.StorageLayout.HierarchicalNamespace").msgclass diff --git a/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb b/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb index 429fbf49cb60..8b840c79c987 100644 --- a/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb +++ b/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb @@ -51,6 +51,9 @@ class Service # source and destination folders are locked until the long running operation # completes. rpc :RenameFolder, ::Google::Cloud::Storage::Control::V2::RenameFolderRequest, ::Google::Longrunning::Operation + # Deletes a folder recursively. This operation is only applicable to a + # hierarchical namespace enabled bucket. + rpc :DeleteFolderRecursive, ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest, ::Google::Longrunning::Operation # Returns the storage layout configuration for a given bucket. rpc :GetStorageLayout, ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest, ::Google::Cloud::Storage::Control::V2::StorageLayout # Creates a new managed folder. diff --git a/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb b/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb index 79b9ee6196da..517504e5d5c1 100644 --- a/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb +++ b/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb @@ -221,6 +221,29 @@ class RenameFolderRequest extend ::Google::Protobuf::MessageExts::ClassMethods end + # Request message for DeleteFolderRecursive. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the folder being deleted, however all of its contents + # will be deleted too. Format: + # `projects/{project}/buckets/{bucket}/folders/{folder}` + # @!attribute [rw] if_metageneration_match + # @return [::Integer] + # Optional. Makes the operation only succeed conditional on whether the root + # folder's current metageneration matches the given value. + # @!attribute [rw] if_metageneration_not_match + # @return [::Integer] + # Optional. Makes the operation only succeed conditional on whether the root + # folder's current metageneration does not match the given value. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A unique identifier for this request. UUID is the recommended + # format, but other formats are still accepted. + class DeleteFolderRecursiveRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The message contains metadata that is common to all Storage Control # long-running operations, present in its `google.longrunning.Operation` # messages, and accessible via `metadata.common_metadata`. @@ -264,6 +287,19 @@ class RenameFolderMetadata extend ::Google::Protobuf::MessageExts::ClassMethods end + # Message returned in the metadata field of the Operation resource for + # DeleteFolderRecursive operations. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] + # Generic metadata for the long running operation. + # @!attribute [rw] folder_id + # @return [::String] + # The path of the folder recursively deleted. + class DeleteFolderRecursiveMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The storage layout configuration of a bucket. # @!attribute [r] name # @return [::String] diff --git a/google-cloud-storage-control-v2/snippets/iam_policy/get_iam_policy.rb b/google-cloud-storage-control-v2/snippets/iam_policy/get_iam_policy.rb deleted file mode 100644 index 7b3d0eedd448..000000000000 --- a/google-cloud-storage-control-v2/snippets/iam_policy/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_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 storage_v2_generated_IAMPolicy_GetIamPolicy_sync] diff --git a/google-cloud-storage-control-v2/snippets/iam_policy/set_iam_policy.rb b/google-cloud-storage-control-v2/snippets/iam_policy/set_iam_policy.rb deleted file mode 100644 index 9ae5f62c9b4e..000000000000 --- a/google-cloud-storage-control-v2/snippets/iam_policy/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_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 storage_v2_generated_IAMPolicy_SetIamPolicy_sync] diff --git a/google-cloud-storage-control-v2/snippets/iam_policy/test_iam_permissions.rb b/google-cloud-storage-control-v2/snippets/iam_policy/test_iam_permissions.rb deleted file mode 100644 index 0f34682aba32..000000000000 --- a/google-cloud-storage-control-v2/snippets/iam_policy/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_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 storage_v2_generated_IAMPolicy_TestIamPermissions_sync] diff --git a/google-cloud-storage-control-v2/snippets/snippet_metadata_google.iam.v1.json b/google-cloud-storage-control-v2/snippets/snippet_metadata_google.iam.v1.json deleted file mode 100644 index ef2fa503d243..000000000000 --- a/google-cloud-storage-control-v2/snippets/snippet_metadata_google.iam.v1.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-storage-control-v2", - "version": "1.8.1", - "language": "RUBY", - "apis": [ - { - "id": "google.iam.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "storage_v2_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": "storage_v2_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": "storage_v2_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/google-cloud-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json b/google-cloud-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json index 182e54806adf..111571493cb1 100644 --- a/google-cloud-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json +++ b/google-cloud-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json @@ -211,6 +211,46 @@ } ] }, + { + "region_tag": "storage_v2_generated_StorageControl_DeleteFolderRecursive_sync", + "title": "Snippet for the delete_folder_recursive call in the StorageControl service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder_recursive.", + "file": "storage_control/delete_folder_recursive.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_folder_recursive", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder_recursive", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StorageControl::Client", + "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" + }, + "method": { + "short_name": "DeleteFolderRecursive", + "full_name": "google.storage.control.v2.StorageControl.DeleteFolderRecursive", + "service": { + "short_name": "StorageControl", + "full_name": "google.storage.control.v2.StorageControl" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, { "region_tag": "storage_v2_generated_StorageControl_GetStorageLayout_sync", "title": "Snippet for the get_storage_layout call in the StorageControl service", diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder_recursive.rb b/google-cloud-storage-control-v2/snippets/storage_control/delete_folder_recursive.rb similarity index 100% rename from owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder_recursive.rb rename to google-cloud-storage-control-v2/snippets/storage_control/delete_folder_recursive.rb diff --git a/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb b/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb index 0cadf6b831f7..299e56f9be02 100644 --- a/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb +++ b/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb @@ -411,6 +411,77 @@ def test_rename_folder end end + def test_delete_folder_recursive + # 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" + if_metageneration_match = 42 + if_metageneration_not_match = 42 + request_id = "hello world" + + delete_folder_recursive_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_folder_recursive, name + assert_kind_of ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["if_metageneration_match"] + assert request.has_if_metageneration_match? + assert_equal 42, request["if_metageneration_not_match"] + assert request.has_if_metageneration_not_match? + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_folder_recursive_client_stub do + # Create client + client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_folder_recursive({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive(::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive_client_stub.call_rpc_count + end + end + def test_get_storage_layout # Create GRPC objects. grpc_response = ::Google::Cloud::Storage::Control::V2::StorageLayout.new diff --git a/google-cloud-storage-control-v2/test/google/iam/v1/iam_policy_rest_test.rb b/google-cloud-storage-control-v2/test/google/iam/v1/iam_policy_rest_test.rb deleted file mode 100644 index 5e313396bf44..000000000000 --- a/google-cloud-storage-control-v2/test/google/iam/v1/iam_policy_rest_test.rb +++ /dev/null @@ -1,265 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/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: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::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:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::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:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::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/google-cloud-storage-control-v2/test/google/iam/v1/iam_policy_test.rb b/google-cloud-storage-control-v2/test/google/iam/v1/iam_policy_test.rb deleted file mode 100644 index f60c94a5c543..000000000000 --- a/google-cloud-storage-control-v2/test/google/iam/v1/iam_policy_test.rb +++ /dev/null @@ -1,286 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/iam/v1/iam_policy_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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_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 - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Iam::V1::IAMPolicy::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/.gitignore b/owl-bot-staging/google-cloud-storage-control-v2/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/.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-storage-control-v2/.repo-metadata.json b/owl-bot-staging/google-cloud-storage-control-v2/.repo-metadata.json deleted file mode 100644 index 9dc1067e6b4b..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "storage.googleapis.com", - "api_shortname": "storage", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-storage-control-v2/latest", - "distribution_name": "google-cloud-storage-control-v2", - "is_cloud": true, - "language": "ruby", - "name": "storage", - "name_pretty": "Storage Control V2 API", - "product_documentation": "https://cloud.google.com/storage/docs/overview", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "The Google Cloud Storage API allows applications to read and write data through the abstractions of buckets and objects, which are similar to directories and files except that buckets cannot contain other buckets, and directory-level operations (like directory rename) are not supported. Buckets share a single global namespace, and each bucket belongs to a specific project that has an associated owner that pays for the data stored in the bucket. This API is accessed using standard gRPC requests. Note that google-cloud-storage-control-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage-control instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/storage/docs/overview", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-storage-control-v2/.rubocop.yml b/owl-bot-staging/google-cloud-storage-control-v2/.rubocop.yml deleted file mode 100644 index c9354c029feb..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-storage-control-v2.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-storage-control-v2.rb" diff --git a/owl-bot-staging/google-cloud-storage-control-v2/.toys.rb b/owl-bot-staging/google-cloud-storage-control-v2/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/.yardopts b/owl-bot-staging/google-cloud-storage-control-v2/.yardopts deleted file mode 100644 index e4425bd31ee0..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Storage Control V2 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-storage-control-v2/AUTHENTICATION.md b/owl-bot-staging/google-cloud-storage-control-v2/AUTHENTICATION.md deleted file mode 100644 index 9672b7b75ce0..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-storage-control-v2 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-storage-control-v2 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/storage/control/v2" - -client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/storage/control/v2" - -::Google::Cloud::Storage::Control::V2::StorageControl::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Storage::Control::V2::StorageControl::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-storage-control-v2 -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/storage/control/v2" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Storage::Control::V2::StorageControl::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-storage-control-v2/CHANGELOG.md b/owl-bot-staging/google-cloud-storage-control-v2/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-storage-control-v2/Gemfile b/owl-bot-staging/google-cloud-storage-control-v2/Gemfile deleted file mode 100644 index 6442df18fa2f..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.31.1" -gem "minitest", "~> 5.22" -gem "minitest-focus", "~> 1.4" -gem "minitest-rg", "~> 5.3" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-storage-control-v2/LICENSE.md b/owl-bot-staging/google-cloud-storage-control-v2/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/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-storage-control-v2/README.md b/owl-bot-staging/google-cloud-storage-control-v2/README.md deleted file mode 100644 index ba465335ff4a..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Storage Control V2 API - -The Storage Control API lets you perform metadata-specific, control plane, and long-running operations. The Storage Control API creates one space to perform metadata-specific, control plane, and long-running operations apart from the Storage API. Separating these operations from the Storage API improves API standardization and lets you run faster releases. - -The Google Cloud Storage API allows applications to read and write data through the abstractions of buckets and objects, which are similar to directories and files except that buckets cannot contain other buckets, and directory-level operations (like directory rename) are not supported. Buckets share a single global namespace, and each bucket belongs to a specific project that has an associated owner that pays for the data stored in the bucket. This API is accessed using standard gRPC requests. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Storage Control V2 API. Most users should consider using -the main client gem, -[google-cloud-storage-control](https://rubygems.org/gems/google-cloud-storage-control). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-storage-control-v2 -``` - -## 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/storage.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/storage/control/v2" - -client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new -request = ::Google::Cloud::Storage::Control::V2::CreateFolderRequest.new # (request fields as keyword arguments...) -response = client.create_folder request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-storage-control-v2/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/storage/docs/overview) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/cloud/storage/control/v2" -require "logger" - -client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.logger = Logger.new "my-app.log" -end -``` - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-storage-control`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-storage-control-v2`. -_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-storage-control`. -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-storage-control-v2`. - -### 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-storage-control-v2/Rakefile b/owl-bot-staging/google-cloud-storage-control-v2/Rakefile deleted file mode 100644 index c1ef5dea7f73..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/Rakefile +++ /dev/null @@ -1,169 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = 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-storage-control-v2 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/storage/control/v2/storage_control/credentials" - ::Google::Cloud::Storage::Control::V2::StorageControl::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-storage-control-v2 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-storage-control-v2 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-storage-control-v2 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-storage-control-v2 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-storage-control-v2" - header "google-cloud-storage-control-v2 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-storage-control-v2 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-storage-control-v2 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-storage-control-v2 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-storage-control-v2 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-storage-control-v2/gapic_metadata.json b/owl-bot-staging/google-cloud-storage-control-v2/gapic_metadata.json deleted file mode 100644 index c36e20575fbc..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/gapic_metadata.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.storage.control.v2", - "libraryPackage": "::Google::Cloud::Storage::Control::V2", - "services": { - "StorageControl": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Storage::Control::V2::StorageControl::Client", - "rpcs": { - "CreateFolder": { - "methods": [ - "create_folder" - ] - }, - "DeleteFolder": { - "methods": [ - "delete_folder" - ] - }, - "GetFolder": { - "methods": [ - "get_folder" - ] - }, - "ListFolders": { - "methods": [ - "list_folders" - ] - }, - "RenameFolder": { - "methods": [ - "rename_folder" - ] - }, - "DeleteFolderRecursive": { - "methods": [ - "delete_folder_recursive" - ] - }, - "GetStorageLayout": { - "methods": [ - "get_storage_layout" - ] - }, - "CreateManagedFolder": { - "methods": [ - "create_managed_folder" - ] - }, - "DeleteManagedFolder": { - "methods": [ - "delete_managed_folder" - ] - }, - "GetManagedFolder": { - "methods": [ - "get_managed_folder" - ] - }, - "ListManagedFolders": { - "methods": [ - "list_managed_folders" - ] - }, - "CreateAnywhereCache": { - "methods": [ - "create_anywhere_cache" - ] - }, - "UpdateAnywhereCache": { - "methods": [ - "update_anywhere_cache" - ] - }, - "DisableAnywhereCache": { - "methods": [ - "disable_anywhere_cache" - ] - }, - "PauseAnywhereCache": { - "methods": [ - "pause_anywhere_cache" - ] - }, - "ResumeAnywhereCache": { - "methods": [ - "resume_anywhere_cache" - ] - }, - "GetAnywhereCache": { - "methods": [ - "get_anywhere_cache" - ] - }, - "ListAnywhereCaches": { - "methods": [ - "list_anywhere_caches" - ] - }, - "GetProjectIntelligenceConfig": { - "methods": [ - "get_project_intelligence_config" - ] - }, - "UpdateProjectIntelligenceConfig": { - "methods": [ - "update_project_intelligence_config" - ] - }, - "GetFolderIntelligenceConfig": { - "methods": [ - "get_folder_intelligence_config" - ] - }, - "UpdateFolderIntelligenceConfig": { - "methods": [ - "update_folder_intelligence_config" - ] - }, - "GetOrganizationIntelligenceConfig": { - "methods": [ - "get_organization_intelligence_config" - ] - }, - "UpdateOrganizationIntelligenceConfig": { - "methods": [ - "update_organization_intelligence_config" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-storage-control-v2/google-cloud-storage-control-v2.gemspec b/owl-bot-staging/google-cloud-storage-control-v2/google-cloud-storage-control-v2.gemspec deleted file mode 100644 index 70edb0b14eed..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/google-cloud-storage-control-v2.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/storage/control/v2/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-storage-control-v2" - gem.version = Google::Cloud::Storage::Control::V2::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "The Google Cloud Storage API allows applications to read and write data through the abstractions of buckets and objects, which are similar to directories and files except that buckets cannot contain other buckets, and directory-level operations (like directory rename) are not supported. Buckets share a single global namespace, and each bucket belongs to a specific project that has an associated owner that pays for the data stored in the bucket. This API is accessed using standard gRPC requests. Note that google-cloud-storage-control-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-storage-control instead. See the readme for more details." - gem.summary = "The Storage Control API lets you perform metadata-specific, control plane, and long-running operations. The Storage Control API creates one space to perform metadata-specific, control plane, and long-running operations apart from the Storage API. Separating these operations from the Storage API improves API standardization and lets you run faster releases." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `git ls-files -- proto_docs/*`.split("\n") + - ["README.md", "LICENSE.md", "AUTHENTICATION.md", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 3.1" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb deleted file mode 100644 index c8a5475de0b5..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google-cloud-storage-control-v2.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# 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/storage/control/v2" diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2.rb deleted file mode 100644 index b529c031a2e8..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/storage/control/v2/storage_control" -require "google/cloud/storage/control/v2/version" - -module Google - module Cloud - module Storage - module Control - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/storage/control/v2" - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/storage/control/v2" - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - module V2 - end - end - end - end -end - -helper_path = ::File.join __dir__, "v2", "_helpers.rb" -require "google/cloud/storage/control/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/rest.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/rest.rb deleted file mode 100644 index 8e031b6fa014..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/rest.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/storage/control/v2/storage_control/rest" -require "google/cloud/storage/control/v2/version" - -module Google - module Cloud - module Storage - module Control - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/storage/control/v2/rest" - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - module V2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control.rb deleted file mode 100644 index 4cfe356728f2..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/storage/control/v2/version" - -require "google/cloud/storage/control/v2/storage_control/credentials" -require "google/cloud/storage/control/v2/storage_control/paths" -require "google/cloud/storage/control/v2/storage_control/operations" -require "google/cloud/storage/control/v2/storage_control/client" -require "google/cloud/storage/control/v2/storage_control/rest" - -module Google - module Cloud - module Storage - module Control - module V2 - ## - # StorageControl service includes selected control plane operations. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/storage/control/v2/storage_control" - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/storage/control/v2/storage_control/rest" - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - module StorageControl - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "storage_control", "helpers.rb" -require "google/cloud/storage/control/v2/storage_control/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb deleted file mode 100644 index 4a311841cf98..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/client.rb +++ /dev/null @@ -1,3379 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/storage/control/v2/storage_control_pb" - -module Google - module Cloud - module Storage - module Control - module V2 - module StorageControl - ## - # Client for the StorageControl service. - # - # StorageControl service includes selected control plane operations. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storage.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :storage_control_stub - - ## - # Configure the StorageControl Client class. - # - # See {::Google::Cloud::Storage::Control::V2::StorageControl::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all StorageControl clients - # ::Google::Cloud::Storage::Control::V2::StorageControl::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", "Storage", "Control", "V2"] - 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.timeout = 60.0 - - default_config.rpcs.create_folder.timeout = 60.0 - default_config.rpcs.create_folder.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_folder.timeout = 60.0 - default_config.rpcs.get_folder.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.list_folders.timeout = 60.0 - default_config.rpcs.list_folders.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.rename_folder.timeout = 60.0 - default_config.rpcs.rename_folder.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.delete_folder_recursive.timeout = 60.0 - default_config.rpcs.delete_folder_recursive.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_storage_layout.timeout = 60.0 - default_config.rpcs.get_storage_layout.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_managed_folder.timeout = 60.0 - default_config.rpcs.get_managed_folder.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.list_managed_folders.timeout = 60.0 - default_config.rpcs.list_managed_folders.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.create_anywhere_cache.timeout = 60.0 - default_config.rpcs.create_anywhere_cache.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.update_anywhere_cache.timeout = 60.0 - default_config.rpcs.update_anywhere_cache.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.disable_anywhere_cache.timeout = 60.0 - default_config.rpcs.disable_anywhere_cache.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.pause_anywhere_cache.timeout = 60.0 - default_config.rpcs.pause_anywhere_cache.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.resume_anywhere_cache.timeout = 60.0 - default_config.rpcs.resume_anywhere_cache.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_anywhere_cache.timeout = 60.0 - default_config.rpcs.get_anywhere_cache.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.list_anywhere_caches.timeout = 60.0 - default_config.rpcs.list_anywhere_caches.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_project_intelligence_config.timeout = 60.0 - default_config.rpcs.get_project_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.update_project_intelligence_config.timeout = 60.0 - default_config.rpcs.update_project_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_folder_intelligence_config.timeout = 60.0 - default_config.rpcs.get_folder_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.update_folder_intelligence_config.timeout = 60.0 - default_config.rpcs.update_folder_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_organization_intelligence_config.timeout = 60.0 - default_config.rpcs.get_organization_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.update_organization_intelligence_config.timeout = 60.0 - default_config.rpcs.update_organization_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the StorageControl 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::Storage::Control::V2::StorageControl::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 - @storage_control_stub.universe_domain - end - - ## - # Create a new StorageControl client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the StorageControl 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/storage/control/v2/storage_control_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 - - @storage_control_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Storage::Control::V2::StorageControl::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool, - logger: @config.logger - ) - - @storage_control_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Storage::Control::V2::StorageControl::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @storage_control_stub.logger - end - - # Service calls - - ## - # Creates a new folder. This operation is only applicable to a hierarchical - # namespace enabled bucket. - # - # @overload create_folder(request, options = nil) - # Pass arguments to `create_folder` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::CreateFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::CreateFolderRequest, ::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_folder(parent: nil, folder: nil, folder_id: nil, recursive: nil, request_id: nil) - # Pass arguments to `create_folder` 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 the bucket in which the folder will reside. The bucket - # must be a hierarchical namespace enabled bucket. - # @param folder [::Google::Cloud::Storage::Control::V2::Folder, ::Hash] - # Required. Properties of the new folder being created. - # The bucket and name of the folder are specified in the parent and folder_id - # fields, respectively. Populating those fields in `folder` will result in an - # error. - # @param folder_id [::String] - # Required. The full name of a folder, including all its parent folders. - # Folders use single '/' characters as a delimiter. - # The folder_id must end with a slash. - # For example, the folder_id of "books/biographies/" would create a new - # "biographies/" folder under the "books/" folder. - # @param recursive [::Boolean] - # Optional. If true, parent folder doesn't have to be present and all missing - # ancestor folders will be created atomically. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::Folder] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::Folder] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::CreateFolderRequest.new - # - # # Call the create_folder method. - # result = client.create_folder request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::Folder. - # p result - # - def create_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::CreateFolderRequest - - # 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_folder.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::Storage::Control::V2::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 && !request.parent.empty? - header_params["bucket"] = request.parent - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :create_folder, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Permanently deletes an empty folder. This operation is only applicable to a - # hierarchical namespace enabled bucket. - # - # @overload delete_folder(request, options = nil) - # Pass arguments to `delete_folder` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::DeleteFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::DeleteFolderRequest, ::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_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) - # Pass arguments to `delete_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the folder. - # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` - # @param if_metageneration_match [::Integer] - # Makes the operation only succeed conditional on whether the folder's - # current metageneration matches the given value. - # @param if_metageneration_not_match [::Integer] - # Makes the operation only succeed conditional on whether the folder's - # current metageneration does not match the given value. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new - # - # # Call the delete_folder method. - # result = client.delete_folder request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest - - # 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_folder.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::Storage::Control::V2::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 - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :delete_folder, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for the specified folder. This operation is only - # applicable to a hierarchical namespace enabled bucket. - # - # @overload get_folder(request, options = nil) - # Pass arguments to `get_folder` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetFolderRequest, ::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_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) - # Pass arguments to `get_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the folder. - # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` - # @param if_metageneration_match [::Integer] - # Makes the operation only succeed conditional on whether the folder's - # current metageneration matches the given value. - # @param if_metageneration_not_match [::Integer] - # Makes the operation only succeed conditional on whether the folder's - # current metageneration does not match the given value. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::Folder] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::Folder] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetFolderRequest.new - # - # # Call the get_folder method. - # result = client.get_folder request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::Folder. - # p result - # - def get_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetFolderRequest - - # 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_folder.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::Storage::Control::V2::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 - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :get_folder, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a list of folders. This operation is only applicable to a - # hierarchical namespace enabled bucket. - # - # @overload list_folders(request, options = nil) - # Pass arguments to `list_folders` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::ListFoldersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::ListFoldersRequest, ::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_folders(parent: nil, page_size: nil, page_token: nil, prefix: nil, delimiter: nil, lexicographic_start: nil, lexicographic_end: nil, request_id: nil) - # Pass arguments to `list_folders` 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 the bucket in which to look for folders. The bucket must - # be a hierarchical namespace enabled bucket. - # @param page_size [::Integer] - # Optional. Maximum number of folders to return in a single response. The - # service will use this parameter or 1,000 items, whichever is smaller. - # @param page_token [::String] - # Optional. A previously-returned page token representing part of the larger - # set of results to view. - # @param prefix [::String] - # Optional. Filter results to folders whose names begin with this prefix. - # If set, the value must either be an empty string or end with a '/'. - # @param delimiter [::String] - # Optional. If set, returns results in a directory-like mode. The results - # will only include folders that either exactly match the above prefix, or - # are one level below the prefix. The only supported value is '/'. - # @param lexicographic_start [::String] - # Optional. Filter results to folders whose names are lexicographically equal - # to or after lexicographic_start. If lexicographic_end is also set, the - # folders listed have names between lexicographic_start (inclusive) and - # lexicographic_end (exclusive). - # @param lexicographic_end [::String] - # Optional. Filter results to folders whose names are lexicographically - # before lexicographic_end. If lexicographic_start is also set, the folders - # listed have names between lexicographic_start (inclusive) and - # lexicographic_end (exclusive). - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::Folder>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::Folder>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::ListFoldersRequest.new - # - # # Call the list_folders method. - # result = client.list_folders 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::Storage::Control::V2::Folder. - # p item - # end - # - def list_folders request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListFoldersRequest - - # 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_folders.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::Storage::Control::V2::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 && !request.parent.empty? - header_params["bucket"] = request.parent - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_folders.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_folders.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :list_folders, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @storage_control_stub, :list_folders, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Renames a source folder to a destination folder. This operation is only - # applicable to a hierarchical namespace enabled bucket. During a rename, the - # source and destination folders are locked until the long running operation - # completes. - # - # @overload rename_folder(request, options = nil) - # Pass arguments to `rename_folder` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::RenameFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::RenameFolderRequest, ::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 rename_folder(name: nil, destination_folder_id: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) - # Pass arguments to `rename_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the source folder being renamed. - # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` - # @param destination_folder_id [::String] - # Required. The destination folder ID, e.g. `foo/bar/`. - # @param if_metageneration_match [::Integer] - # Makes the operation only succeed conditional on whether the source - # folder's current metageneration matches the given value. - # @param if_metageneration_not_match [::Integer] - # Makes the operation only succeed conditional on whether the source - # folder's current metageneration does not match the given value. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - # - # @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/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::RenameFolderRequest.new - # - # # Call the rename_folder method. - # result = client.rename_folder 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 rename_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::RenameFolderRequest - - # 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.rename_folder.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::Storage::Control::V2::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 - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.rename_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.rename_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :rename_folder, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a folder recursively. This operation is only applicable to a - # hierarchical namespace enabled bucket. - # - # @overload delete_folder_recursive(request, options = nil) - # Pass arguments to `delete_folder_recursive` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest, ::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_folder_recursive(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) - # Pass arguments to `delete_folder_recursive` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the folder being deleted, however all of its contents - # will be deleted too. Format: - # `projects/{project}/buckets/{bucket}/folders/{folder}` - # @param if_metageneration_match [::Integer] - # Optional. Makes the operation only succeed conditional on whether the root - # folder's current metageneration matches the given value. - # @param if_metageneration_not_match [::Integer] - # Optional. Makes the operation only succeed conditional on whether the root - # folder's current metageneration does not match the given value. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @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/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new - # - # # Call the delete_folder_recursive method. - # result = client.delete_folder_recursive 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_folder_recursive request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest - - # 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_folder_recursive.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::Storage::Control::V2::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 - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_folder_recursive.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_folder_recursive.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :delete_folder_recursive, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the storage layout configuration for a given bucket. - # - # @overload get_storage_layout(request, options = nil) - # Pass arguments to `get_storage_layout` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest, ::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_storage_layout(name: nil, prefix: nil, request_id: nil) - # Pass arguments to `get_storage_layout` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the StorageLayout resource. - # Format: `projects/{project}/buckets/{bucket}/storageLayout` - # @param prefix [::String] - # An optional prefix used for permission check. It is useful when the caller - # only has limited permissions under a specific prefix. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::StorageLayout] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::StorageLayout] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new - # - # # Call the get_storage_layout method. - # result = client.get_storage_layout request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::StorageLayout. - # p result - # - def get_storage_layout request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest - - # 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_storage_layout.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::Storage::Control::V2::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 - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_storage_layout.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_storage_layout.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :get_storage_layout, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new managed folder. - # - # @overload create_managed_folder(request, options = nil) - # Pass arguments to `create_managed_folder` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest, ::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_managed_folder(parent: nil, managed_folder: nil, managed_folder_id: nil, request_id: nil) - # Pass arguments to `create_managed_folder` 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 the bucket this managed folder belongs to. - # @param managed_folder [::Google::Cloud::Storage::Control::V2::ManagedFolder, ::Hash] - # Required. Properties of the managed folder being created. - # The bucket and managed folder names are specified in the `parent` and - # `managed_folder_id` fields. Populating these fields in `managed_folder` - # will result in an error. - # @param managed_folder_id [::String] - # Required. The name of the managed folder. It uses a single `/` as delimiter - # and leading and trailing `/` are allowed. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::ManagedFolder] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::ManagedFolder] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest.new - # - # # Call the create_managed_folder method. - # result = client.create_managed_folder request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::ManagedFolder. - # p result - # - def create_managed_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest - - # 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_managed_folder.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::Storage::Control::V2::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 && !request.parent.empty? - header_params["bucket"] = request.parent - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_managed_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_managed_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :create_managed_folder, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Permanently deletes an empty managed folder. - # - # @overload delete_managed_folder(request, options = nil) - # Pass arguments to `delete_managed_folder` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest, ::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_managed_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, allow_non_empty: nil, request_id: nil) - # Pass arguments to `delete_managed_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the managed folder. - # Format: - # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` - # @param if_metageneration_match [::Integer] - # The operation succeeds conditional on the managed folder's current - # metageneration matching the value here specified. - # @param if_metageneration_not_match [::Integer] - # The operation succeeds conditional on the managed folder's current - # metageneration NOT matching the value here specified. - # @param allow_non_empty [::Boolean] - # Allows deletion of a managed folder even if it is not empty. - # A managed folder is empty if it manages no child managed folders or - # objects. Caller must have permission for - # storage.managedFolders.setIamPolicy. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest.new - # - # # Call the delete_managed_folder method. - # result = client.delete_managed_folder request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_managed_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest - - # 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_managed_folder.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::Storage::Control::V2::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 - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_managed_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_managed_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :delete_managed_folder, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns metadata for the specified managed folder. - # - # @overload get_managed_folder(request, options = nil) - # Pass arguments to `get_managed_folder` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest, ::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_managed_folder(name: nil, if_metageneration_match: nil, if_metageneration_not_match: nil, request_id: nil) - # Pass arguments to `get_managed_folder` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. Name of the managed folder. - # Format: - # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` - # @param if_metageneration_match [::Integer] - # The operation succeeds conditional on the managed folder's current - # metageneration matching the value here specified. - # @param if_metageneration_not_match [::Integer] - # The operation succeeds conditional on the managed folder's current - # metageneration NOT matching the value here specified. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::ManagedFolder] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::ManagedFolder] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetManagedFolderRequest.new - # - # # Call the get_managed_folder method. - # result = client.get_managed_folder request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::ManagedFolder. - # p result - # - def get_managed_folder request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest - - # 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_managed_folder.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::Storage::Control::V2::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 - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_managed_folder.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_managed_folder.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :get_managed_folder, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Retrieves a list of managed folders for a given bucket. - # - # @overload list_managed_folders(request, options = nil) - # Pass arguments to `list_managed_folders` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest, ::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_managed_folders(parent: nil, page_size: nil, page_token: nil, prefix: nil, request_id: nil) - # Pass arguments to `list_managed_folders` 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 the bucket this managed folder belongs to. - # @param page_size [::Integer] - # Optional. Maximum number of managed folders to return in a single response. - # The service will use this parameter or 1,000 items, whichever is smaller. - # @param page_token [::String] - # Optional. A previously-returned page token representing part of the larger - # set of results to view. - # @param prefix [::String] - # Optional. Filter results to match managed folders with name starting with - # this prefix. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::ManagedFolder>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::ManagedFolder>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest.new - # - # # Call the list_managed_folders method. - # result = client.list_managed_folders 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::Storage::Control::V2::ManagedFolder. - # p item - # end - # - def list_managed_folders request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest - - # 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_managed_folders.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::Storage::Control::V2::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 && !request.parent.empty? - header_params["bucket"] = request.parent - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_managed_folders.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_managed_folders.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :list_managed_folders, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @storage_control_stub, :list_managed_folders, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates an Anywhere Cache instance. - # - # @overload create_anywhere_cache(request, options = nil) - # Pass arguments to `create_anywhere_cache` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest, ::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_anywhere_cache(parent: nil, anywhere_cache: nil, request_id: nil) - # Pass arguments to `create_anywhere_cache` 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 bucket to which this cache belongs. - # Format: `projects/{project}/buckets/{bucket}` - # @param anywhere_cache [::Google::Cloud::Storage::Control::V2::AnywhereCache, ::Hash] - # Required. Properties of the Anywhere Cache instance being created. - # The parent bucket name is specified in the `parent` field. Server uses the - # default value of `ttl` or `admission_policy` if not specified in - # request. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - # - # @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/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new - # - # # Call the create_anywhere_cache method. - # result = client.create_anywhere_cache 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 create_anywhere_cache request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest - - # 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_anywhere_cache.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::Storage::Control::V2::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 && !request.parent.empty? - header_params["bucket"] = request.parent - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_anywhere_cache.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_anywhere_cache.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :create_anywhere_cache, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an Anywhere Cache instance. Mutable fields include `ttl` and - # `admission_policy`. - # - # @overload update_anywhere_cache(request, options = nil) - # Pass arguments to `update_anywhere_cache` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_anywhere_cache(anywhere_cache: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_anywhere_cache` 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 anywhere_cache [::Google::Cloud::Storage::Control::V2::AnywhereCache, ::Hash] - # Required. The Anywhere Cache instance to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. List of fields to be updated. Mutable fields of AnywhereCache - # include `ttl` and `admission_policy`. - # - # To specify ALL fields, specify a single field with the value `*`. Note: We - # recommend against doing this. If a new field is introduced at a later time, - # an older client updating with the `*` may accidentally reset the new - # field's value. - # - # Not specifying any fields is an error. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - # - # @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/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new - # - # # Call the update_anywhere_cache method. - # result = client.update_anywhere_cache 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 update_anywhere_cache request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_anywhere_cache.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::Storage::Control::V2::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.anywhere_cache&.name - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.anywhere_cache.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_anywhere_cache.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_anywhere_cache.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :update_anywhere_cache, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Disables an Anywhere Cache instance. A disabled instance is read-only. The - # disablement could be revoked by calling ResumeAnywhereCache. The cache - # instance will be deleted automatically if it remains in the disabled state - # for at least one hour. - # - # @overload disable_anywhere_cache(request, options = nil) - # Pass arguments to `disable_anywhere_cache` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest, ::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 disable_anywhere_cache(name: nil, request_id: nil) - # Pass arguments to `disable_anywhere_cache` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name field in the request should be: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new - # - # # Call the disable_anywhere_cache method. - # result = client.disable_anywhere_cache request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. - # p result - # - def disable_anywhere_cache request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest - - # 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.disable_anywhere_cache.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::Storage::Control::V2::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 - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.disable_anywhere_cache.timeout, - metadata: metadata, - retry_policy: @config.rpcs.disable_anywhere_cache.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :disable_anywhere_cache, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Pauses an Anywhere Cache instance. - # - # @overload pause_anywhere_cache(request, options = nil) - # Pass arguments to `pause_anywhere_cache` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest, ::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 pause_anywhere_cache(name: nil, request_id: nil) - # Pass arguments to `pause_anywhere_cache` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name field in the request should be: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new - # - # # Call the pause_anywhere_cache method. - # result = client.pause_anywhere_cache request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. - # p result - # - def pause_anywhere_cache request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest - - # 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.pause_anywhere_cache.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::Storage::Control::V2::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 - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.pause_anywhere_cache.timeout, - metadata: metadata, - retry_policy: @config.rpcs.pause_anywhere_cache.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :pause_anywhere_cache, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Resumes a disabled or paused Anywhere Cache instance. - # - # @overload resume_anywhere_cache(request, options = nil) - # Pass arguments to `resume_anywhere_cache` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest, ::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 resume_anywhere_cache(name: nil, request_id: nil) - # Pass arguments to `resume_anywhere_cache` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name field in the request should be: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new - # - # # Call the resume_anywhere_cache method. - # result = client.resume_anywhere_cache request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. - # p result - # - def resume_anywhere_cache request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest - - # 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.resume_anywhere_cache.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::Storage::Control::V2::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 - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.resume_anywhere_cache.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resume_anywhere_cache.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :resume_anywhere_cache, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets an Anywhere Cache instance. - # - # @overload get_anywhere_cache(request, options = nil) - # Pass arguments to `get_anywhere_cache` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest, ::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_anywhere_cache(name: nil, request_id: nil) - # Pass arguments to `get_anywhere_cache` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name field in the request should be: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new - # - # # Call the get_anywhere_cache method. - # result = client.get_anywhere_cache request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. - # p result - # - def get_anywhere_cache request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest - - # 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_anywhere_cache.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::Storage::Control::V2::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 - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.name - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_anywhere_cache.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_anywhere_cache.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :get_anywhere_cache, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists Anywhere Cache instances for a given bucket. - # - # @overload list_anywhere_caches(request, options = nil) - # Pass arguments to `list_anywhere_caches` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest, ::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_anywhere_caches(parent: nil, page_size: nil, page_token: nil, request_id: nil) - # Pass arguments to `list_anywhere_caches` 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 bucket to which this cache belongs. - # @param page_size [::Integer] - # Maximum number of caches to return in a single response. - # The service will use this parameter or 1,000 items, whichever is smaller. - # @param page_token [::String] - # A previously-returned page token representing part of the larger set of - # results to view. - # @param request_id [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::AnywhereCache>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Storage::Control::V2::AnywhereCache>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new - # - # # Call the list_anywhere_caches method. - # result = client.list_anywhere_caches 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::Storage::Control::V2::AnywhereCache. - # p item - # end - # - def list_anywhere_caches request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest - - # 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_anywhere_caches.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::Storage::Control::V2::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 && !request.parent.empty? - header_params["bucket"] = request.parent - end - - request_params_header = URI.encode_www_form header_params - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_anywhere_caches.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_anywhere_caches.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :list_anywhere_caches, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @storage_control_stub, :list_anywhere_caches, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the Project scoped singleton IntelligenceConfig resource. - # - # @overload get_project_intelligence_config(request, options = nil) - # Pass arguments to `get_project_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, ::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_project_intelligence_config(name: nil) - # Pass arguments to `get_project_intelligence_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your project. - # - # Format: `projects/{id}/locations/global/intelligenceConfig` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new - # - # # Call the get_project_intelligence_config method. - # result = client.get_project_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def get_project_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest - - # 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_project_intelligence_config.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::Storage::Control::V2::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_project_intelligence_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_project_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :get_project_intelligence_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the Project scoped singleton IntelligenceConfig resource. - # - # @overload update_project_intelligence_config(request, options = nil) - # Pass arguments to `update_project_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_project_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_project_intelligence_config` 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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] - # Required. The `IntelligenceConfig` resource to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @param request_id [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new - # - # # Call the update_project_intelligence_config method. - # result = client.update_project_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def update_project_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_project_intelligence_config.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::Storage::Control::V2::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.intelligence_config&.name - header_params["intelligence_config.name"] = request.intelligence_config.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_project_intelligence_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_project_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :update_project_intelligence_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the Folder scoped singleton IntelligenceConfig resource. - # - # @overload get_folder_intelligence_config(request, options = nil) - # Pass arguments to `get_folder_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, ::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_folder_intelligence_config(name: nil) - # Pass arguments to `get_folder_intelligence_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your folder. - # - # Format: `folders/{id}/locations/global/intelligenceConfig` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new - # - # # Call the get_folder_intelligence_config method. - # result = client.get_folder_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def get_folder_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest - - # 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_folder_intelligence_config.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::Storage::Control::V2::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_folder_intelligence_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_folder_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :get_folder_intelligence_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the Folder scoped singleton IntelligenceConfig resource. - # - # @overload update_folder_intelligence_config(request, options = nil) - # Pass arguments to `update_folder_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_folder_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_folder_intelligence_config` 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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] - # Required. The `IntelligenceConfig` resource to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @param request_id [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new - # - # # Call the update_folder_intelligence_config method. - # result = client.update_folder_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def update_folder_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_folder_intelligence_config.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::Storage::Control::V2::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.intelligence_config&.name - header_params["intelligence_config.name"] = request.intelligence_config.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_folder_intelligence_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_folder_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :update_folder_intelligence_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the Organization scoped singleton IntelligenceConfig resource. - # - # @overload get_organization_intelligence_config(request, options = nil) - # Pass arguments to `get_organization_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, ::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_organization_intelligence_config(name: nil) - # Pass arguments to `get_organization_intelligence_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your organization. - # - # Format: `organizations/{org_id}/locations/global/intelligenceConfig` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new - # - # # Call the get_organization_intelligence_config method. - # result = client.get_organization_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def get_organization_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest - - # 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_organization_intelligence_config.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::Storage::Control::V2::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_organization_intelligence_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_organization_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :get_organization_intelligence_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the Organization scoped singleton IntelligenceConfig resource. - # - # @overload update_organization_intelligence_config(request, options = nil) - # Pass arguments to `update_organization_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload update_organization_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_organization_intelligence_config` 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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] - # Required. The `IntelligenceConfig` resource to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @param request_id [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new - # - # # Call the update_organization_intelligence_config method. - # result = client.update_organization_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def update_organization_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.update_organization_intelligence_config.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::Storage::Control::V2::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.intelligence_config&.name - header_params["intelligence_config.name"] = request.intelligence_config.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.update_organization_intelligence_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_organization_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.call_rpc :update_organization_intelligence_config, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the IAM policy for a specified bucket. - # The `resource` field in the request should be - # `projects/_/buckets/{bucket}` for a bucket, or - # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - # for a managed folder. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::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::Storage::Control::V2::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 && !request.resource.empty? - header_params["bucket"] = request.resource - end - if request.resource - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.resource - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - 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 - - @storage_control_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates an IAM policy for the specified bucket. - # The `resource` field in the request should be - # `projects/_/buckets/{bucket}` for a bucket, or - # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - # for a managed folder. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::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::Storage::Control::V2::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 && !request.resource.empty? - header_params["bucket"] = request.resource - end - if request.resource - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)(?:/.*)?$}.match request.resource - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - 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 - - @storage_control_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Tests a set of permissions on the given bucket, object, or managed folder - # to see which, if any, are held by the caller. - # The `resource` field in the request should be - # `projects/_/buckets/{bucket}` for a bucket, - # `projects/_/buckets/{bucket}/objects/{object}` for an object, or - # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - # for a managed folder. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::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::Storage::Control::V2::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 && !request.resource.empty? - header_params["bucket"] = request.resource - end - if request.resource - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)/objects(?:/.*)?$}.match request.resource - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - if request.resource - regex_match = %r{^(?projects/[^/]+/buckets/[^/]+)/managedFolders(?:/.*)?$}.match request.resource - if regex_match - header_params["bucket"] = regex_match["bucket".to_s] - end - end - - request_params_header = URI.encode_www_form header_params - 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 - - @storage_control_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the StorageControl API. - # - # This class represents the configuration for StorageControl, - # 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::Storage::Control::V2::StorageControl::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_folder to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Storage::Control::V2::StorageControl::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_folder.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_folder.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "storage.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the StorageControl 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_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :create_folder - ## - # RPC-specific configuration for `delete_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_folder - ## - # RPC-specific configuration for `get_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :get_folder - ## - # RPC-specific configuration for `list_folders` - # @return [::Gapic::Config::Method] - # - attr_reader :list_folders - ## - # RPC-specific configuration for `rename_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :rename_folder - ## - # RPC-specific configuration for `delete_folder_recursive` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_folder_recursive - ## - # RPC-specific configuration for `get_storage_layout` - # @return [::Gapic::Config::Method] - # - attr_reader :get_storage_layout - ## - # RPC-specific configuration for `create_managed_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :create_managed_folder - ## - # RPC-specific configuration for `delete_managed_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_managed_folder - ## - # RPC-specific configuration for `get_managed_folder` - # @return [::Gapic::Config::Method] - # - attr_reader :get_managed_folder - ## - # RPC-specific configuration for `list_managed_folders` - # @return [::Gapic::Config::Method] - # - attr_reader :list_managed_folders - ## - # RPC-specific configuration for `create_anywhere_cache` - # @return [::Gapic::Config::Method] - # - attr_reader :create_anywhere_cache - ## - # RPC-specific configuration for `update_anywhere_cache` - # @return [::Gapic::Config::Method] - # - attr_reader :update_anywhere_cache - ## - # RPC-specific configuration for `disable_anywhere_cache` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_anywhere_cache - ## - # RPC-specific configuration for `pause_anywhere_cache` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_anywhere_cache - ## - # RPC-specific configuration for `resume_anywhere_cache` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_anywhere_cache - ## - # RPC-specific configuration for `get_anywhere_cache` - # @return [::Gapic::Config::Method] - # - attr_reader :get_anywhere_cache - ## - # RPC-specific configuration for `list_anywhere_caches` - # @return [::Gapic::Config::Method] - # - attr_reader :list_anywhere_caches - ## - # RPC-specific configuration for `get_project_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_project_intelligence_config - ## - # RPC-specific configuration for `update_project_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_project_intelligence_config - ## - # RPC-specific configuration for `get_folder_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_folder_intelligence_config - ## - # RPC-specific configuration for `update_folder_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_folder_intelligence_config - ## - # RPC-specific configuration for `get_organization_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_organization_intelligence_config - ## - # RPC-specific configuration for `update_organization_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_organization_intelligence_config - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - create_folder_config = parent_rpcs.create_folder if parent_rpcs.respond_to? :create_folder - @create_folder = ::Gapic::Config::Method.new create_folder_config - delete_folder_config = parent_rpcs.delete_folder if parent_rpcs.respond_to? :delete_folder - @delete_folder = ::Gapic::Config::Method.new delete_folder_config - get_folder_config = parent_rpcs.get_folder if parent_rpcs.respond_to? :get_folder - @get_folder = ::Gapic::Config::Method.new get_folder_config - list_folders_config = parent_rpcs.list_folders if parent_rpcs.respond_to? :list_folders - @list_folders = ::Gapic::Config::Method.new list_folders_config - rename_folder_config = parent_rpcs.rename_folder if parent_rpcs.respond_to? :rename_folder - @rename_folder = ::Gapic::Config::Method.new rename_folder_config - delete_folder_recursive_config = parent_rpcs.delete_folder_recursive if parent_rpcs.respond_to? :delete_folder_recursive - @delete_folder_recursive = ::Gapic::Config::Method.new delete_folder_recursive_config - get_storage_layout_config = parent_rpcs.get_storage_layout if parent_rpcs.respond_to? :get_storage_layout - @get_storage_layout = ::Gapic::Config::Method.new get_storage_layout_config - create_managed_folder_config = parent_rpcs.create_managed_folder if parent_rpcs.respond_to? :create_managed_folder - @create_managed_folder = ::Gapic::Config::Method.new create_managed_folder_config - delete_managed_folder_config = parent_rpcs.delete_managed_folder if parent_rpcs.respond_to? :delete_managed_folder - @delete_managed_folder = ::Gapic::Config::Method.new delete_managed_folder_config - get_managed_folder_config = parent_rpcs.get_managed_folder if parent_rpcs.respond_to? :get_managed_folder - @get_managed_folder = ::Gapic::Config::Method.new get_managed_folder_config - list_managed_folders_config = parent_rpcs.list_managed_folders if parent_rpcs.respond_to? :list_managed_folders - @list_managed_folders = ::Gapic::Config::Method.new list_managed_folders_config - create_anywhere_cache_config = parent_rpcs.create_anywhere_cache if parent_rpcs.respond_to? :create_anywhere_cache - @create_anywhere_cache = ::Gapic::Config::Method.new create_anywhere_cache_config - update_anywhere_cache_config = parent_rpcs.update_anywhere_cache if parent_rpcs.respond_to? :update_anywhere_cache - @update_anywhere_cache = ::Gapic::Config::Method.new update_anywhere_cache_config - disable_anywhere_cache_config = parent_rpcs.disable_anywhere_cache if parent_rpcs.respond_to? :disable_anywhere_cache - @disable_anywhere_cache = ::Gapic::Config::Method.new disable_anywhere_cache_config - pause_anywhere_cache_config = parent_rpcs.pause_anywhere_cache if parent_rpcs.respond_to? :pause_anywhere_cache - @pause_anywhere_cache = ::Gapic::Config::Method.new pause_anywhere_cache_config - resume_anywhere_cache_config = parent_rpcs.resume_anywhere_cache if parent_rpcs.respond_to? :resume_anywhere_cache - @resume_anywhere_cache = ::Gapic::Config::Method.new resume_anywhere_cache_config - get_anywhere_cache_config = parent_rpcs.get_anywhere_cache if parent_rpcs.respond_to? :get_anywhere_cache - @get_anywhere_cache = ::Gapic::Config::Method.new get_anywhere_cache_config - list_anywhere_caches_config = parent_rpcs.list_anywhere_caches if parent_rpcs.respond_to? :list_anywhere_caches - @list_anywhere_caches = ::Gapic::Config::Method.new list_anywhere_caches_config - get_project_intelligence_config_config = parent_rpcs.get_project_intelligence_config if parent_rpcs.respond_to? :get_project_intelligence_config - @get_project_intelligence_config = ::Gapic::Config::Method.new get_project_intelligence_config_config - update_project_intelligence_config_config = parent_rpcs.update_project_intelligence_config if parent_rpcs.respond_to? :update_project_intelligence_config - @update_project_intelligence_config = ::Gapic::Config::Method.new update_project_intelligence_config_config - get_folder_intelligence_config_config = parent_rpcs.get_folder_intelligence_config if parent_rpcs.respond_to? :get_folder_intelligence_config - @get_folder_intelligence_config = ::Gapic::Config::Method.new get_folder_intelligence_config_config - update_folder_intelligence_config_config = parent_rpcs.update_folder_intelligence_config if parent_rpcs.respond_to? :update_folder_intelligence_config - @update_folder_intelligence_config = ::Gapic::Config::Method.new update_folder_intelligence_config_config - get_organization_intelligence_config_config = parent_rpcs.get_organization_intelligence_config if parent_rpcs.respond_to? :get_organization_intelligence_config - @get_organization_intelligence_config = ::Gapic::Config::Method.new get_organization_intelligence_config_config - update_organization_intelligence_config_config = parent_rpcs.update_organization_intelligence_config if parent_rpcs.respond_to? :update_organization_intelligence_config - @update_organization_intelligence_config = ::Gapic::Config::Method.new update_organization_intelligence_config_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/credentials.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/credentials.rb deleted file mode 100644 index c65981e2f69b..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/credentials.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "googleauth" - -module Google - module Cloud - module Storage - module Control - module V2 - module StorageControl - # Credentials for the StorageControl API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - 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 -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/operations.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/operations.rb deleted file mode 100644 index 3ba9c91b393a..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/operations.rb +++ /dev/null @@ -1,843 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Cloud - module Storage - module Control - module V2 - module StorageControl - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storage.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the StorageControl 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 StorageControl 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`. - # - # @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, return_partial_success: 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. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @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::Storage::Control::V2::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? - throw :response, 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::Storage::Control::V2::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? - throw :response, 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::Storage::Control::V2::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? - 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::Storage::Control::V2::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? - 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::Storage::Control::V2::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? - throw :response, 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: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "storage.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the 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 -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/paths.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/paths.rb deleted file mode 100644 index 669b90f12a51..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/paths.rb +++ /dev/null @@ -1,178 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Storage - module Control - module V2 - module StorageControl - # Path helper methods for the StorageControl API. - module Paths - ## - # Create a fully-qualified AnywhereCache resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # - # @param project [String] - # @param bucket [String] - # @param anywhere_cache [String] - # - # @return [::String] - def anywhere_cache_path project:, bucket:, anywhere_cache: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" - - "projects/#{project}/buckets/#{bucket}/anywhereCaches/#{anywhere_cache}" - end - - ## - # Create a fully-qualified Bucket resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/buckets/{bucket}` - # - # @param project [String] - # @param bucket [String] - # - # @return [::String] - def bucket_path project:, bucket: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/buckets/#{bucket}" - end - - ## - # Create a fully-qualified Folder resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/buckets/{bucket}/folders/{folder=**}` - # - # @param project [String] - # @param bucket [String] - # @param folder [String] - # - # @return [::String] - def folder_path project:, bucket:, folder: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" - - "projects/#{project}/buckets/#{bucket}/folders/#{folder}" - end - - ## - # Create a fully-qualified IntelligenceConfig resource string. - # - # @overload intelligence_config_path(folder:, location:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/intelligenceConfig` - # - # @param folder [String] - # @param location [String] - # - # @overload intelligence_config_path(org:, location:) - # The resource will be in the following format: - # - # `organizations/{org}/locations/{location}/intelligenceConfig` - # - # @param org [String] - # @param location [String] - # - # @overload intelligence_config_path(project:, location:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/intelligenceConfig` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def intelligence_config_path **args - resources = { - "folder:location" => (proc do |folder:, location:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/intelligenceConfig" - end), - "location:org" => (proc do |org:, location:| - raise ::ArgumentError, "org cannot contain /" if org.to_s.include? "/" - - "organizations/#{org}/locations/#{location}/intelligenceConfig" - end), - "location:project" => (proc do |project:, location:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/intelligenceConfig" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - ## - # Create a fully-qualified ManagedFolder resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}` - # - # @param project [String] - # @param bucket [String] - # @param managed_folder [String] - # - # @return [::String] - def managed_folder_path project:, bucket:, managed_folder: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/" - - "projects/#{project}/buckets/#{bucket}/managedFolders/#{managed_folder}" - end - - ## - # Create a fully-qualified StorageLayout resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/buckets/{bucket}/storageLayout` - # - # @param project [String] - # @param bucket [String] - # - # @return [::String] - def storage_layout_path project:, bucket: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/buckets/#{bucket}/storageLayout" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest.rb deleted file mode 100644 index afbdecc7fabf..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/storage/control/v2/version" - -require "google/cloud/storage/control/v2/storage_control/credentials" -require "google/cloud/storage/control/v2/storage_control/paths" -require "google/cloud/storage/control/v2/storage_control/rest/client" - -module Google - module Cloud - module Storage - module Control - module V2 - ## - # StorageControl service includes selected control plane operations. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/storage/control/v2/storage_control/rest" - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - module StorageControl - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/storage/control/v2/storage_control/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/client.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/client.rb deleted file mode 100644 index b1c5439c8bfa..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/client.rb +++ /dev/null @@ -1,913 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/cloud/errors" -require "google/storage/control/v2/storage_control_pb" -require "google/cloud/storage/control/v2/storage_control/rest/service_stub" - -module Google - module Cloud - module Storage - module Control - module V2 - module StorageControl - module Rest - ## - # REST client for the StorageControl service. - # - # StorageControl service includes selected control plane operations. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "storage.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :storage_control_stub - - ## - # Configure the StorageControl Client class. - # - # See {::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all StorageControl clients - # ::Google::Cloud::Storage::Control::V2::StorageControl::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", "Storage", "Control", "V2"] - 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.timeout = 60.0 - - default_config.rpcs.get_project_intelligence_config.timeout = 60.0 - default_config.rpcs.get_project_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.update_project_intelligence_config.timeout = 60.0 - default_config.rpcs.update_project_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_folder_intelligence_config.timeout = 60.0 - default_config.rpcs.get_folder_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.update_folder_intelligence_config.timeout = 60.0 - default_config.rpcs.update_folder_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.get_organization_intelligence_config.timeout = 60.0 - default_config.rpcs.get_organization_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config.rpcs.update_organization_intelligence_config.timeout = 60.0 - default_config.rpcs.update_organization_intelligence_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 2, retry_codes: [8, 14, 4, 13, 2] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the StorageControl 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::Storage::Control::V2::StorageControl::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 - @storage_control_stub.universe_domain - end - - ## - # Create a new StorageControl REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the StorageControl 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 - - @storage_control_stub = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @storage_control_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @storage_control_stub.logger - end - - # Service calls - - ## - # Returns the Project scoped singleton IntelligenceConfig resource. - # - # @overload get_project_intelligence_config(request, options = nil) - # Pass arguments to `get_project_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, ::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_project_intelligence_config(name: nil) - # Pass arguments to `get_project_intelligence_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your project. - # - # Format: `projects/{id}/locations/global/intelligenceConfig` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new - # - # # Call the get_project_intelligence_config method. - # result = client.get_project_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def get_project_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest - - # 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_project_intelligence_config.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::Storage::Control::V2::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_project_intelligence_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_project_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.get_project_intelligence_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the Project scoped singleton IntelligenceConfig resource. - # - # @overload update_project_intelligence_config(request, options = nil) - # Pass arguments to `update_project_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_project_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_project_intelligence_config` 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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] - # Required. The `IntelligenceConfig` resource to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @param request_id [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new - # - # # Call the update_project_intelligence_config method. - # result = client.update_project_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def update_project_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_project_intelligence_config.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::Storage::Control::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_project_intelligence_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_project_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.update_project_intelligence_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the Folder scoped singleton IntelligenceConfig resource. - # - # @overload get_folder_intelligence_config(request, options = nil) - # Pass arguments to `get_folder_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, ::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_folder_intelligence_config(name: nil) - # Pass arguments to `get_folder_intelligence_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your folder. - # - # Format: `folders/{id}/locations/global/intelligenceConfig` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new - # - # # Call the get_folder_intelligence_config method. - # result = client.get_folder_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def get_folder_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest - - # 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_folder_intelligence_config.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::Storage::Control::V2::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_folder_intelligence_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_folder_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.get_folder_intelligence_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the Folder scoped singleton IntelligenceConfig resource. - # - # @overload update_folder_intelligence_config(request, options = nil) - # Pass arguments to `update_folder_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_folder_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_folder_intelligence_config` 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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] - # Required. The `IntelligenceConfig` resource to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @param request_id [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new - # - # # Call the update_folder_intelligence_config method. - # result = client.update_folder_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def update_folder_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_folder_intelligence_config.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::Storage::Control::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_folder_intelligence_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_folder_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.update_folder_intelligence_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns the Organization scoped singleton IntelligenceConfig resource. - # - # @overload get_organization_intelligence_config(request, options = nil) - # Pass arguments to `get_organization_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, ::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_organization_intelligence_config(name: nil) - # Pass arguments to `get_organization_intelligence_config` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your organization. - # - # Format: `organizations/{org_id}/locations/global/intelligenceConfig` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new - # - # # Call the get_organization_intelligence_config method. - # result = client.get_organization_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def get_organization_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest - - # 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_organization_intelligence_config.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::Storage::Control::V2::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_organization_intelligence_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_organization_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.get_organization_intelligence_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates the Organization scoped singleton IntelligenceConfig resource. - # - # @overload update_organization_intelligence_config(request, options = nil) - # Pass arguments to `update_organization_intelligence_config` via a request object, either of type - # {::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload update_organization_intelligence_config(intelligence_config: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_organization_intelligence_config` 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 intelligence_config [::Google::Cloud::Storage::Control::V2::IntelligenceConfig, ::Hash] - # Required. The `IntelligenceConfig` resource to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @param request_id [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/storage/control/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new - # - # # Call the update_organization_intelligence_config method. - # result = client.update_organization_intelligence_config request - # - # # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - # p result - # - def update_organization_intelligence_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.update_organization_intelligence_config.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::Storage::Control::V2::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_organization_intelligence_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_organization_intelligence_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @storage_control_stub.update_organization_intelligence_config request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the StorageControl REST API. - # - # This class represents the configuration for StorageControl 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::Storage::Control::V2::StorageControl::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 - # # get_project_intelligence_config to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_project_intelligence_config.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_project_intelligence_config.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "storage.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the StorageControl 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 `get_project_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_project_intelligence_config - ## - # RPC-specific configuration for `update_project_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_project_intelligence_config - ## - # RPC-specific configuration for `get_folder_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_folder_intelligence_config - ## - # RPC-specific configuration for `update_folder_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_folder_intelligence_config - ## - # RPC-specific configuration for `get_organization_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_organization_intelligence_config - ## - # RPC-specific configuration for `update_organization_intelligence_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_organization_intelligence_config - - # @private - def initialize parent_rpcs = nil - get_project_intelligence_config_config = parent_rpcs.get_project_intelligence_config if parent_rpcs.respond_to? :get_project_intelligence_config - @get_project_intelligence_config = ::Gapic::Config::Method.new get_project_intelligence_config_config - update_project_intelligence_config_config = parent_rpcs.update_project_intelligence_config if parent_rpcs.respond_to? :update_project_intelligence_config - @update_project_intelligence_config = ::Gapic::Config::Method.new update_project_intelligence_config_config - get_folder_intelligence_config_config = parent_rpcs.get_folder_intelligence_config if parent_rpcs.respond_to? :get_folder_intelligence_config - @get_folder_intelligence_config = ::Gapic::Config::Method.new get_folder_intelligence_config_config - update_folder_intelligence_config_config = parent_rpcs.update_folder_intelligence_config if parent_rpcs.respond_to? :update_folder_intelligence_config - @update_folder_intelligence_config = ::Gapic::Config::Method.new update_folder_intelligence_config_config - get_organization_intelligence_config_config = parent_rpcs.get_organization_intelligence_config if parent_rpcs.respond_to? :get_organization_intelligence_config - @get_organization_intelligence_config = ::Gapic::Config::Method.new get_organization_intelligence_config_config - update_organization_intelligence_config_config = parent_rpcs.update_organization_intelligence_config if parent_rpcs.respond_to? :update_organization_intelligence_config - @update_organization_intelligence_config = ::Gapic::Config::Method.new update_organization_intelligence_config_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb deleted file mode 100644 index 5c5d5c81ed57..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/storage_control/rest/service_stub.rb +++ /dev/null @@ -1,452 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "google/storage/control/v2/storage_control_pb" - -module Google - module Cloud - module Storage - module Control - module V2 - module StorageControl - module Rest - ## - # REST service stub for the StorageControl service. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - # - class ServiceStub - # @private - def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials, - numeric_enums: true, - service_name: self.class, - raise_faraday_errors: false, - logger: logger - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @client_stub.universe_domain - end - - ## - # The effective endpoint - # - # @return [String] - # - def endpoint - @client_stub.endpoint - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger stub: false - stub ? @client_stub.stub_logger : @client_stub.logger - end - - ## - # Baseline implementation for the get_project_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest] - # 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::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # A result object deserialized from the server's reply - def get_project_intelligence_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_project_intelligence_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_project_intelligence_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_project_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest] - # 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::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # A result object deserialized from the server's reply - def update_project_intelligence_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_project_intelligence_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_project_intelligence_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_folder_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest] - # 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::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # A result object deserialized from the server's reply - def get_folder_intelligence_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_folder_intelligence_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_folder_intelligence_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_folder_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest] - # 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::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # A result object deserialized from the server's reply - def update_folder_intelligence_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_folder_intelligence_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_folder_intelligence_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the get_organization_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest] - # 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::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # A result object deserialized from the server's reply - def get_organization_intelligence_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_organization_intelligence_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_organization_intelligence_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the update_organization_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest] - # 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::Storage::Control::V2::IntelligenceConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # A result object deserialized from the server's reply - def update_organization_intelligence_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_organization_intelligence_config_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "update_organization_intelligence_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # @private - # - # GRPC transcoding helper method for the get_project_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest] - # 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_project_intelligence_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_project_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_project_intelligence_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{intelligence_config.name}", - body: "intelligence_config", - matches: [ - ["intelligence_config.name", %r{^projects/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_folder_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest] - # 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_folder_intelligence_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_folder_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_folder_intelligence_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{intelligence_config.name}", - body: "intelligence_config", - matches: [ - ["intelligence_config.name", %r{^folders/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_organization_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest] - # 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_organization_intelligence_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_organization_intelligence_config REST call - # - # @param request_pb [::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_update_organization_intelligence_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v2/{intelligence_config.name}", - body: "intelligence_config", - matches: [ - ["intelligence_config.name", %r{^organizations/[^/]+/locations/[^/]+/intelligenceConfig/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/version.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/version.rb deleted file mode 100644 index 41fdc28eedf0..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/cloud/storage/control/v2/version.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Storage - module Control - module V2 - VERSION = "0.0.1" - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb deleted file mode 100644 index 13efa67f3d74..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_pb.rb +++ /dev/null @@ -1,107 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/storage/control/v2/storage_control.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/api/routing_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n/google/storage/control/v2/storage_control.proto\x12\x19google.storage.control.v2\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\x18google/api/routing.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"+\n\x11PendingRenameInfo\x12\x16\n\toperation\x18\x01 \x01(\tB\x03\xe0\x41\x03\"\xe2\x02\n\x06\x46older\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0emetageneration\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12N\n\x13pending_rename_info\x18\x07 \x01(\x0b\x32,.google.storage.control.v2.PendingRenameInfoB\x03\xe0\x41\x03:l\xea\x41i\n\x1dstorage.googleapis.com/Folder\x12\x37projects/{project}/buckets/{bucket}/folders/{folder=**}*\x07\x66olders2\x06\x66older\"\xf4\x01\n\x10GetFolderRequest\x12\x33\n\x04name\x18\x06 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xd5\x01\n\x13\x43reateFolderRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dstorage.googleapis.com/Folder\x12\x36\n\x06\x66older\x18\x02 \x01(\x0b\x32!.google.storage.control.v2.FolderB\x03\xe0\x41\x02\x12\x16\n\tfolder_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\trecursive\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xf7\x01\n\x13\x44\x65leteFolderRequest\x12\x33\n\x04name\x18\x06 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x8c\x02\n\x12ListFoldersRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dstorage.googleapis.com/Folder\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06prefix\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tdelimiter\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12 \n\x13lexicographic_start\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11lexicographic_end\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\t \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"b\n\x13ListFoldersResponse\x12\x32\n\x07\x66olders\x18\x01 \x03(\x0b\x32!.google.storage.control.v2.Folder\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9b\x02\n\x13RenameFolderRequest\x12\x33\n\x04name\x18\x07 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12\"\n\x15\x64\x65stination_folder_id\x18\x08 \x01(\tB\x03\xe0\x41\x02\x12$\n\x17if_metageneration_match\x18\x04 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x05 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x06 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x8a\x02\n\x1c\x44\x65leteFolderRecursiveRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dstorage.googleapis.com/Folder\x12)\n\x17if_metageneration_match\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12-\n\x1bif_metageneration_not_match\x18\x03 \x01(\x03\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\x9a\x02\n\"CommonLongRunningOperationMetadata\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\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04type\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12\x1d\n\x10progress_percent\x18\x06 \x01(\x05\x42\x03\xe0\x41\x03\"\xa7\x01\n\x14RenameFolderMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x18\n\x10source_folder_id\x18\x02 \x01(\t\x12\x1d\n\x15\x64\x65stination_folder_id\x18\x03 \x01(\t\"\x8a\x01\n\x1d\x44\x65leteFolderRecursiveMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x11\n\tfolder_id\x18\x02 \x01(\t\"\xf8\x03\n\rStorageLayout\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08location\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rlocation_type\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x64\n\x17\x63ustom_placement_config\x18\x04 \x01(\x0b\x32>.google.storage.control.v2.StorageLayout.CustomPlacementConfigB\x03\xe0\x41\x03\x12\x63\n\x16hierarchical_namespace\x18\x05 \x01(\x0b\x32>.google.storage.control.v2.StorageLayout.HierarchicalNamespaceB\x03\xe0\x41\x03\x1a/\n\x15\x43ustomPlacementConfig\x12\x16\n\x0e\x64\x61ta_locations\x18\x01 \x03(\t\x1a(\n\x15HierarchicalNamespace\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08:{\xea\x41x\n$storage.googleapis.com/StorageLayout\x12\x31projects/{project}/buckets/{bucket}/storageLayout*\x0estorageLayouts2\rstorageLayout\"\x86\x01\n\x17GetStorageLayoutRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/StorageLayout\x12\x0e\n\x06prefix\x18\x02 \x01(\t\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xbf\x02\n\rManagedFolder\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x1b\n\x0emetageneration\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:\x91\x01\xea\x41\x8d\x01\n$storage.googleapis.com/ManagedFolder\x12\x46projects/{project}/buckets/{bucket}/managedFolders/{managed_folder=**}*\x0emanagedFolders2\rmanagedFolder\"\x82\x02\n\x17GetManagedFolderRequest\x12:\n\x04name\x18\x06 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/ManagedFolder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xe2\x01\n\x1a\x43reateManagedFolderRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/ManagedFolder\x12\x45\n\x0emanaged_folder\x18\x02 \x01(\x0b\x32(.google.storage.control.v2.ManagedFolderB\x03\xe0\x41\x02\x12\x1e\n\x11managed_folder_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\x9e\x02\n\x1a\x44\x65leteManagedFolderRequest\x12:\n\x04name\x18\x07 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/ManagedFolder\x12$\n\x17if_metageneration_match\x18\x03 \x01(\x03H\x00\x88\x01\x01\x12(\n\x1bif_metageneration_not_match\x18\x04 \x01(\x03H\x01\x88\x01\x01\x12\x17\n\x0f\x61llow_non_empty\x18\x05 \x01(\x08\x12\x1f\n\nrequest_id\x18\x06 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x42\x1a\n\x18_if_metageneration_matchB\x1e\n\x1c_if_metageneration_not_match\"\xc0\x01\n\x19ListManagedFoldersRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/ManagedFolder\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x13\n\x06prefix\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1f\n\nrequest_id\x18\x05 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x1aListManagedFoldersResponse\x12\x41\n\x0fmanaged_folders\x18\x01 \x03(\x0b\x32(.google.storage.control.v2.ManagedFolder\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xb0\x02\n\x1b\x43reateAnywhereCacheMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x1e\n\x11\x61nywhere_cache_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04zone\x18\x06 \x01(\tH\x01\x88\x01\x01\x12+\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x02\x88\x01\x01\x12\x1d\n\x10\x61\x64mission_policy\x18\x05 \x01(\tH\x03\x88\x01\x01\x42\x14\n\x12_anywhere_cache_idB\x07\n\x05_zoneB\x06\n\x04_ttlB\x13\n\x11_admission_policy\"\xb0\x02\n\x1bUpdateAnywhereCacheMetadata\x12V\n\x0f\x63ommon_metadata\x18\x01 \x01(\x0b\x32=.google.storage.control.v2.CommonLongRunningOperationMetadata\x12\x1e\n\x11\x61nywhere_cache_id\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04zone\x18\x05 \x01(\tH\x01\x88\x01\x01\x12+\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x02\x88\x01\x01\x12\x1d\n\x10\x61\x64mission_policy\x18\x04 \x01(\tH\x03\x88\x01\x01\x42\x14\n\x12_anywhere_cache_idB\x07\n\x05_zoneB\x06\n\x04_ttlB\x13\n\x11_admission_policy\"\xa5\x03\n\rAnywhereCache\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x11\n\x04zone\x18\n \x01(\tB\x03\xe0\x41\x05\x12&\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x18\n\x10\x61\x64mission_policy\x18\t \x01(\t\x12\x12\n\x05state\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1b\n\x0epending_update\x18\x08 \x01(\x08\x42\x03\xe0\x41\x03:\x8e\x01\xea\x41\x8a\x01\n$storage.googleapis.com/AnywhereCache\x12\x43projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}*\x0e\x61nywhereCaches2\ranywhereCache\"\xc2\x01\n\x1a\x43reateAnywhereCacheRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/AnywhereCache\x12\x45\n\x0e\x61nywhere_cache\x18\x03 \x01(\x0b\x32(.google.storage.control.v2.AnywhereCacheB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xba\x01\n\x1aUpdateAnywhereCacheRequest\x12\x45\n\x0e\x61nywhere_cache\x18\x01 \x01(\x0b\x32(.google.storage.control.v2.AnywhereCacheB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"z\n\x1b\x44isableAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x19PauseAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"y\n\x1aResumeAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"v\n\x17GetAnywhereCacheRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$storage.googleapis.com/AnywhereCache\x12\x1f\n\nrequest_id\x18\x02 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xa1\x01\n\x19ListAnywhereCachesRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$storage.googleapis.com/AnywhereCache\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"x\n\x1aListAnywhereCachesResponse\x12\x41\n\x0f\x61nywhere_caches\x18\x01 \x03(\x0b\x32(.google.storage.control.v2.AnywhereCache\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x8e\x0e\n\x12IntelligenceConfig\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12X\n\x0e\x65\x64ition_config\x18\x02 \x01(\x0e\x32;.google.storage.control.v2.IntelligenceConfig.EditionConfigB\x03\xe0\x41\x01\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12I\n\x06\x66ilter\x18\x04 \x01(\x0b\x32\x34.google.storage.control.v2.IntelligenceConfig.FilterB\x03\xe0\x41\x01\x12u\n\x1d\x65\x66\x66\x65\x63tive_intelligence_config\x18\x05 \x01(\x0b\x32I.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfigB\x03\xe0\x41\x03\x12O\n\x0ctrial_config\x18\x07 \x01(\x0b\x32\x39.google.storage.control.v2.IntelligenceConfig.TrialConfig\x1a\xfc\x04\n\x06\x46ilter\x12v\n included_cloud_storage_locations\x18\x01 \x01(\x0b\x32J.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocationsH\x00\x12v\n excluded_cloud_storage_locations\x18\x02 \x01(\x0b\x32J.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocationsH\x00\x12r\n\x1eincluded_cloud_storage_buckets\x18\x03 \x01(\x0b\x32H.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBucketsH\x01\x12r\n\x1e\x65xcluded_cloud_storage_buckets\x18\x04 \x01(\x0b\x32H.google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBucketsH\x01\x1a/\n\x15\x43loudStorageLocations\x12\x16\n\tlocations\x18\x01 \x03(\tB\x03\xe0\x41\x01\x1a\x35\n\x13\x43loudStorageBuckets\x12\x1e\n\x11\x62ucket_id_regexes\x18\x01 \x03(\tB\x03\xe0\x41\x01\x42\x19\n\x17\x63loud_storage_locationsB\x17\n\x15\x63loud_storage_buckets\x1a\x8a\x02\n\x1b\x45\x66\x66\x65\x63tiveIntelligenceConfig\x12z\n\x11\x65\x66\x66\x65\x63tive_edition\x18\x01 \x01(\x0e\x32Z.google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEditionB\x03\xe0\x41\x03\x12 \n\x13intelligence_config\x18\x02 \x01(\tB\x03\xe0\x41\x03\"M\n\x10\x45\x66\x66\x65\x63tiveEdition\x12!\n\x1d\x45\x46\x46\x45\x43TIVE_EDITION_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0c\n\x08STANDARD\x10\x02\x1a\x43\n\x0bTrialConfig\x12\x34\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"c\n\rEditionConfig\x12\x1e\n\x1a\x45\x44ITION_CONFIG_UNSPECIFIED\x10\x00\x12\x0b\n\x07INHERIT\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\x0c\n\x08STANDARD\x10\x03\x12\t\n\x05TRIAL\x10\x05:\x8b\x02\xea\x41\x87\x02\n)storage.googleapis.com/IntelligenceConfig\x12\x38\x66olders/{folder}/locations/{location}/intelligenceConfig\x12;organizations/{org}/locations/{location}/intelligenceConfig\x12:projects/{project}/locations/{location}/intelligenceConfig*\x13intelligenceConfigs2\x12intelligenceConfig\"\xd5\x01\n+UpdateOrganizationIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xcf\x01\n%UpdateFolderIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xd0\x01\n&UpdateProjectIntelligenceConfigRequest\x12O\n\x13intelligence_config\x18\x01 \x01(\x0b\x32-.google.storage.control.v2.IntelligenceConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"k\n(GetOrganizationIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig\"e\n\"GetFolderIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig\"f\n#GetProjectIntelligenceConfigRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)storage.googleapis.com/IntelligenceConfig2\xd2,\n\x0eStorageControl\x12\x9a\x01\n\x0c\x43reateFolder\x12..google.storage.control.v2.CreateFolderRequest\x1a!.google.storage.control.v2.Folder\"7\xda\x41\x17parent,folder,folder_id\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\x8f\x01\n\x0c\x44\x65leteFolder\x12..google.storage.control.v2.DeleteFolderRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\x94\x01\n\tGetFolder\x12+.google.storage.control.v2.GetFolderRequest\x1a!.google.storage.control.v2.Folder\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\x94\x01\n\x0bListFolders\x12-.google.storage.control.v2.ListFoldersRequest\x1a..google.storage.control.v2.ListFoldersResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xcd\x01\n\x0cRenameFolder\x12..google.storage.control.v2.RenameFolderRequest\x1a\x1d.google.longrunning.Operation\"n\xca\x41\x1e\n\x06\x46older\x12\x14RenameFolderMetadata\xda\x41\x1aname,destination_folder_id\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xe1\x01\n\x15\x44\x65leteFolderRecursive\x12\x37.google.storage.control.v2.DeleteFolderRecursiveRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x36\n\x15google.protobuf.Empty\x12\x1d\x44\x65leteFolderRecursiveMetadata\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetStorageLayout\x12\x32.google.storage.control.v2.GetStorageLayoutRequest\x1a(.google.storage.control.v2.StorageLayout\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xbf\x01\n\x13\x43reateManagedFolder\x12\x35.google.storage.control.v2.CreateManagedFolderRequest\x1a(.google.storage.control.v2.ManagedFolder\"G\xda\x41\'parent,managed_folder,managed_folder_id\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\x9d\x01\n\x13\x44\x65leteManagedFolder\x12\x35.google.storage.control.v2.DeleteManagedFolderRequest\x1a\x16.google.protobuf.Empty\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetManagedFolder\x12\x32.google.storage.control.v2.GetManagedFolderRequest\x1a(.google.storage.control.v2.ManagedFolder\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x12ListManagedFolders\x12\x34.google.storage.control.v2.ListManagedFoldersRequest\x1a\x35.google.storage.control.v2.ListManagedFoldersResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xd1\x01\n\x13\x43reateAnywhereCache\x12\x35.google.storage.control.v2.CreateAnywhereCacheRequest\x1a\x1d.google.longrunning.Operation\"d\xca\x41,\n\rAnywhereCache\x12\x1b\x43reateAnywhereCacheMetadata\xda\x41\x15parent,anywhere_cache\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xf9\x01\n\x13UpdateAnywhereCache\x12\x35.google.storage.control.v2.UpdateAnywhereCacheRequest\x1a\x1d.google.longrunning.Operation\"\x8b\x01\xca\x41,\n\rAnywhereCache\x12\x1bUpdateAnywhereCacheMetadata\xda\x41\x1a\x61nywhere_cache,update_mask\x8a\xd3\xe4\x93\x02\x39\x12\x37\n\x13\x61nywhere_cache.name\x12 {bucket=projects/*/buckets/*}/**\x12\xb1\x01\n\x14\x44isableAnywhereCache\x12\x36.google.storage.control.v2.DisableAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xad\x01\n\x12PauseAnywhereCache\x12\x34.google.storage.control.v2.PauseAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xaf\x01\n\x13ResumeAnywhereCache\x12\x35.google.storage.control.v2.ResumeAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x10GetAnywhereCache\x12\x32.google.storage.control.v2.GetAnywhereCacheRequest\x1a(.google.storage.control.v2.AnywhereCache\"7\xda\x41\x04name\x8a\xd3\xe4\x93\x02*\x12(\n\x04name\x12 {bucket=projects/*/buckets/*}/**\x12\xa9\x01\n\x12ListAnywhereCaches\x12\x34.google.storage.control.v2.ListAnywhereCachesRequest\x1a\x35.google.storage.control.v2.ListAnywhereCachesResponse\"&\xda\x41\x06parent\x8a\xd3\xe4\x93\x02\x17\x12\x15\n\x06parent\x12\x0b{bucket=**}\x12\xd2\x01\n\x1cGetProjectIntelligenceConfig\x12>.google.storage.control.v2.GetProjectIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v2/{name=projects/*/locations/*/intelligenceConfig}\x12\x9d\x02\n\x1fUpdateProjectIntelligenceConfig\x12\x41.google.storage.control.v2.UpdateProjectIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x87\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02_2H/v2/{intelligence_config.name=projects/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xcf\x01\n\x1bGetFolderIntelligenceConfig\x12=.google.storage.control.v2.GetFolderIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v2/{name=folders/*/locations/*/intelligenceConfig}\x12\x9a\x02\n\x1eUpdateFolderIntelligenceConfig\x12@.google.storage.control.v2.UpdateFolderIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x86\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02^2G/v2/{intelligence_config.name=folders/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xe1\x01\n!GetOrganizationIntelligenceConfig\x12\x43.google.storage.control.v2.GetOrganizationIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v2/{name=organizations/*/locations/*/intelligenceConfig}\x12\xac\x02\n$UpdateOrganizationIntelligenceConfig\x12\x46.google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest\x1a-.google.storage.control.v2.IntelligenceConfig\"\x8c\x01\xda\x41\x1fintelligence_config,update_mask\x82\xd3\xe4\x93\x02\x64\x32M/v2/{intelligence_config.name=organizations/*/locations/*/intelligenceConfig}:\x13intelligence_config\x12\xa3\x01\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"X\xda\x41\x08resource\x8a\xd3\xe4\x93\x02G\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12,\n\x08resource\x12 {bucket=projects/*/buckets/*}/**\x12\xaa\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"_\xda\x41\x0fresource,policy\x8a\xd3\xe4\x93\x02G\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12,\n\x08resource\x12 {bucket=projects/*/buckets/*}/**\x12\x96\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"\xaa\x01\xda\x41\x14resource,permissions\x8a\xd3\xe4\x93\x02\x8c\x01\x12\x17\n\x08resource\x12\x0b{bucket=**}\x12\x34\n\x08resource\x12({bucket=projects/*/buckets/*}/objects/**\x12;\n\x08resource\x12/{bucket=projects/*/buckets/*}/managedFolders/**\x1a\xa7\x02\xca\x41\x16storage.googleapis.com\xd2\x41\x8a\x02https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-platform.read-only,https://www.googleapis.com/auth/devstorage.full_control,https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/devstorage.read_writeB\xa6\x02\n\x1d\x63om.google.storage.control.v2B\x13StorageControlProtoP\x01Z=cloud.google.com/go/storage/control/apiv2/controlpb;controlpb\xaa\x02\x1fGoogle.Cloud.Storage.Control.V2\xca\x02\x1fGoogle\\Cloud\\Storage\\Control\\V2\xea\x02#Google::Cloud::Storage::Control::V2\xea\x41\x44\n\x1dstorage.googleapis.com/Bucket\x12#projects/{project}/buckets/{bucket}b\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.protobuf.FieldMask", "google/protobuf/field_mask.proto"], - ] - imports.each do |type_name, expected_filename| - import_file = pool.lookup(type_name).file_descriptor - if import_file.name != expected_filename - warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}" - end - end - warn "Each proto file must use a consistent fully-qualified name." - warn "This will become an error in the next major version." -end - -module Google - module Cloud - module Storage - module Control - module V2 - PendingRenameInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.PendingRenameInfo").msgclass - Folder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.Folder").msgclass - GetFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetFolderRequest").msgclass - CreateFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CreateFolderRequest").msgclass - DeleteFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteFolderRequest").msgclass - ListFoldersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListFoldersRequest").msgclass - ListFoldersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListFoldersResponse").msgclass - RenameFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.RenameFolderRequest").msgclass - DeleteFolderRecursiveRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteFolderRecursiveRequest").msgclass - CommonLongRunningOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CommonLongRunningOperationMetadata").msgclass - RenameFolderMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.RenameFolderMetadata").msgclass - DeleteFolderRecursiveMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteFolderRecursiveMetadata").msgclass - StorageLayout = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.StorageLayout").msgclass - StorageLayout::CustomPlacementConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.StorageLayout.CustomPlacementConfig").msgclass - StorageLayout::HierarchicalNamespace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.StorageLayout.HierarchicalNamespace").msgclass - GetStorageLayoutRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetStorageLayoutRequest").msgclass - ManagedFolder = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ManagedFolder").msgclass - GetManagedFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetManagedFolderRequest").msgclass - CreateManagedFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CreateManagedFolderRequest").msgclass - DeleteManagedFolderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DeleteManagedFolderRequest").msgclass - ListManagedFoldersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListManagedFoldersRequest").msgclass - ListManagedFoldersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListManagedFoldersResponse").msgclass - CreateAnywhereCacheMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CreateAnywhereCacheMetadata").msgclass - UpdateAnywhereCacheMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateAnywhereCacheMetadata").msgclass - AnywhereCache = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.AnywhereCache").msgclass - CreateAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.CreateAnywhereCacheRequest").msgclass - UpdateAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateAnywhereCacheRequest").msgclass - DisableAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.DisableAnywhereCacheRequest").msgclass - PauseAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.PauseAnywhereCacheRequest").msgclass - ResumeAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ResumeAnywhereCacheRequest").msgclass - GetAnywhereCacheRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetAnywhereCacheRequest").msgclass - ListAnywhereCachesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListAnywhereCachesRequest").msgclass - ListAnywhereCachesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.ListAnywhereCachesResponse").msgclass - IntelligenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig").msgclass - IntelligenceConfig::Filter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.Filter").msgclass - IntelligenceConfig::Filter::CloudStorageLocations = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations").msgclass - IntelligenceConfig::Filter::CloudStorageBuckets = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets").msgclass - IntelligenceConfig::EffectiveIntelligenceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig").msgclass - IntelligenceConfig::EffectiveIntelligenceConfig::EffectiveEdition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition").enummodule - IntelligenceConfig::TrialConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.TrialConfig").msgclass - IntelligenceConfig::EditionConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.IntelligenceConfig.EditionConfig").enummodule - UpdateOrganizationIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest").msgclass - UpdateFolderIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateFolderIntelligenceConfigRequest").msgclass - UpdateProjectIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.UpdateProjectIntelligenceConfigRequest").msgclass - GetOrganizationIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetOrganizationIntelligenceConfigRequest").msgclass - GetFolderIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetFolderIntelligenceConfigRequest").msgclass - GetProjectIntelligenceConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.storage.control.v2.GetProjectIntelligenceConfigRequest").msgclass - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb b/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb deleted file mode 100644 index e631a002bf14..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/lib/google/storage/control/v2/storage_control_services_pb.rb +++ /dev/null @@ -1,125 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/storage/control/v2/storage_control.proto for package 'Google.Cloud.Storage.Control.V2' -# Original file comments: -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# 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/storage/control/v2/storage_control_pb' - -module Google - module Cloud - module Storage - module Control - module V2 - module StorageControl - # StorageControl service includes selected control plane operations. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.storage.control.v2.StorageControl' - - # Creates a new folder. This operation is only applicable to a hierarchical - # namespace enabled bucket. - rpc :CreateFolder, ::Google::Cloud::Storage::Control::V2::CreateFolderRequest, ::Google::Cloud::Storage::Control::V2::Folder - # Permanently deletes an empty folder. This operation is only applicable to a - # hierarchical namespace enabled bucket. - rpc :DeleteFolder, ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest, ::Google::Protobuf::Empty - # Returns metadata for the specified folder. This operation is only - # applicable to a hierarchical namespace enabled bucket. - rpc :GetFolder, ::Google::Cloud::Storage::Control::V2::GetFolderRequest, ::Google::Cloud::Storage::Control::V2::Folder - # Retrieves a list of folders. This operation is only applicable to a - # hierarchical namespace enabled bucket. - rpc :ListFolders, ::Google::Cloud::Storage::Control::V2::ListFoldersRequest, ::Google::Cloud::Storage::Control::V2::ListFoldersResponse - # Renames a source folder to a destination folder. This operation is only - # applicable to a hierarchical namespace enabled bucket. During a rename, the - # source and destination folders are locked until the long running operation - # completes. - rpc :RenameFolder, ::Google::Cloud::Storage::Control::V2::RenameFolderRequest, ::Google::Longrunning::Operation - # Deletes a folder recursively. This operation is only applicable to a - # hierarchical namespace enabled bucket. - rpc :DeleteFolderRecursive, ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest, ::Google::Longrunning::Operation - # Returns the storage layout configuration for a given bucket. - rpc :GetStorageLayout, ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest, ::Google::Cloud::Storage::Control::V2::StorageLayout - # Creates a new managed folder. - rpc :CreateManagedFolder, ::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest, ::Google::Cloud::Storage::Control::V2::ManagedFolder - # Permanently deletes an empty managed folder. - rpc :DeleteManagedFolder, ::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest, ::Google::Protobuf::Empty - # Returns metadata for the specified managed folder. - rpc :GetManagedFolder, ::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest, ::Google::Cloud::Storage::Control::V2::ManagedFolder - # Retrieves a list of managed folders for a given bucket. - rpc :ListManagedFolders, ::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest, ::Google::Cloud::Storage::Control::V2::ListManagedFoldersResponse - # Creates an Anywhere Cache instance. - rpc :CreateAnywhereCache, ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest, ::Google::Longrunning::Operation - # Updates an Anywhere Cache instance. Mutable fields include `ttl` and - # `admission_policy`. - rpc :UpdateAnywhereCache, ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest, ::Google::Longrunning::Operation - # Disables an Anywhere Cache instance. A disabled instance is read-only. The - # disablement could be revoked by calling ResumeAnywhereCache. The cache - # instance will be deleted automatically if it remains in the disabled state - # for at least one hour. - rpc :DisableAnywhereCache, ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest, ::Google::Cloud::Storage::Control::V2::AnywhereCache - # Pauses an Anywhere Cache instance. - rpc :PauseAnywhereCache, ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest, ::Google::Cloud::Storage::Control::V2::AnywhereCache - # Resumes a disabled or paused Anywhere Cache instance. - rpc :ResumeAnywhereCache, ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest, ::Google::Cloud::Storage::Control::V2::AnywhereCache - # Gets an Anywhere Cache instance. - rpc :GetAnywhereCache, ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest, ::Google::Cloud::Storage::Control::V2::AnywhereCache - # Lists Anywhere Cache instances for a given bucket. - rpc :ListAnywhereCaches, ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest, ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesResponse - # Returns the Project scoped singleton IntelligenceConfig resource. - rpc :GetProjectIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig - # Updates the Project scoped singleton IntelligenceConfig resource. - rpc :UpdateProjectIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig - # Returns the Folder scoped singleton IntelligenceConfig resource. - rpc :GetFolderIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig - # Updates the Folder scoped singleton IntelligenceConfig resource. - rpc :UpdateFolderIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig - # Returns the Organization scoped singleton IntelligenceConfig resource. - rpc :GetOrganizationIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig - # Updates the Organization scoped singleton IntelligenceConfig resource. - rpc :UpdateOrganizationIntelligenceConfig, ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest, ::Google::Cloud::Storage::Control::V2::IntelligenceConfig - # Gets the IAM policy for a specified bucket. - # The `resource` field in the request should be - # `projects/_/buckets/{bucket}` for a bucket, or - # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - # for a managed folder. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Updates an IAM policy for the specified bucket. - # The `resource` field in the request should be - # `projects/_/buckets/{bucket}` for a bucket, or - # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - # for a managed folder. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Tests a set of permissions on the given bucket, object, or managed folder - # to see which, if any, are held by the caller. - # The `resource` field in the request should be - # `projects/_/buckets/{bucket}` for a bucket, - # `projects/_/buckets/{bucket}/objects/{object}` for an object, or - # `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` - # for a managed folder. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/README.md b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/README.md deleted file mode 100644 index 1aefe1559ea2..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Storage Control V2 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-storage-control-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/client.rb deleted file mode 100644 index d59ba51a5612..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,473 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - class CommonLanguageSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details about how and where to publish client libraries. - # @!attribute [rw] version - # @return [::String] - # Version of the API to apply these settings to. This is the full protobuf - # package for the API, ending in the version element. - # Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - # @!attribute [rw] launch_stage - # @return [::Google::Api::LaunchStage] - # Launch stage of this version of the API. - # @!attribute [rw] rest_numeric_enums - # @return [::Boolean] - # When using transport=rest, the client request will encode enums as - # numbers rather than strings. - # @!attribute [rw] java_settings - # @return [::Google::Api::JavaSettings] - # Settings for legacy Java features, supported in the Service YAML. - # @!attribute [rw] cpp_settings - # @return [::Google::Api::CppSettings] - # Settings for C++ client libraries. - # @!attribute [rw] php_settings - # @return [::Google::Api::PhpSettings] - # Settings for PHP client libraries. - # @!attribute [rw] python_settings - # @return [::Google::Api::PythonSettings] - # Settings for Python client libraries. - # @!attribute [rw] node_settings - # @return [::Google::Api::NodeSettings] - # Settings for Node client libraries. - # @!attribute [rw] dotnet_settings - # @return [::Google::Api::DotnetSettings] - # Settings for .NET client libraries. - # @!attribute [rw] ruby_settings - # @return [::Google::Api::RubySettings] - # Settings for Ruby client libraries. - # @!attribute [rw] go_settings - # @return [::Google::Api::GoSettings] - # Settings for Go client libraries. - class ClientLibrarySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This message configures the settings for publishing [Google Cloud Client - # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - # generated from the service config. - # @!attribute [rw] method_settings - # @return [::Array<::Google::Api::MethodSettings>] - # A list of API method settings, e.g. the behavior for methods that use the - # long-running operation pattern. - # @!attribute [rw] new_issue_uri - # @return [::String] - # Link to a *public* URI where users can report issues. Example: - # https://issuetracker.google.com/issues/new?component=190865&template=1161103 - # @!attribute [rw] documentation_uri - # @return [::String] - # Link to product home page. Example: - # https://cloud.google.com/asset-inventory/docs/overview - # @!attribute [rw] api_short_name - # @return [::String] - # Used as a tracking tag when collecting data about the APIs developer - # relations artifacts like docs, packages delivered to package managers, - # etc. Example: "speech". - # @!attribute [rw] github_label - # @return [::String] - # GitHub label to apply to issues and pull requests opened for this API. - # @!attribute [rw] codeowner_github_teams - # @return [::Array<::String>] - # GitHub teams to be added to CODEOWNERS in the directory in GitHub - # containing source code for the client libraries for this API. - # @!attribute [rw] doc_tag_prefix - # @return [::String] - # A prefix used in sample code when demarking regions to be included in - # documentation. - # @!attribute [rw] organization - # @return [::Google::Api::ClientLibraryOrganization] - # For whom the client library is being published. - # @!attribute [rw] library_settings - # @return [::Array<::Google::Api::ClientLibrarySettings>] - # Client library settings. If the same version string appears multiple - # times in this list, then the last one wins. Settings from earlier - # settings with the same version string are discarded. - # @!attribute [rw] proto_reference_documentation_uri - # @return [::String] - # Optional link to proto reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rpc - # @!attribute [rw] rest_reference_documentation_uri - # @return [::String] - # Optional link to REST reference documentation. Example: - # https://cloud.google.com/pubsub/lite/docs/reference/rest - class Publishing - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Java client libraries. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Java. Clobbers the java_package option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.java.package_name" field - # in gapic.yaml. API teams should use the protobuf java_package option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # library_package: com.google.cloud.pubsub.v1 - # @!attribute [rw] service_class_names - # @return [::Google::Protobuf::Map{::String => ::String}] - # Configure the Java class name to use instead of the service's for its - # corresponding generated GAPIC client. Keys are fully-qualified - # service names as they appear in the protobuf (including the full - # the language_settings.java.interface_names" field in gapic.yaml. API - # teams should otherwise use the service name as it appears in the - # protobuf. - # - # Example of a YAML configuration:: - # - # publishing: - # java_settings: - # service_class_names: - # - google.pubsub.v1.Publisher: TopicAdmin - # - google.pubsub.v1.Subscriber: SubscriptionAdmin - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class JavaSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class ServiceClassNamesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for C++ client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class CppSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Php client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class PhpSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Python client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] experimental_features - # @return [::Google::Api::PythonSettings::ExperimentalFeatures] - # Experimental features to be included during client library generation. - class PythonSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Experimental features to be included during client library generation. - # These fields will be deprecated once the feature graduates and is enabled - # by default. - # @!attribute [rw] rest_async_io_enabled - # @return [::Boolean] - # Enables generation of asynchronous REST clients if `rest` transport is - # enabled. By default, asynchronous REST clients will not be generated. - # This feature will be enabled by default 1 month after launching the - # feature in preview packages. - # @!attribute [rw] protobuf_pythonic_types_enabled - # @return [::Boolean] - # Enables generation of protobuf code using new types that are more - # Pythonic which are included in `protobuf>=5.29.x`. This feature will be - # enabled by default 1 month after launching the feature in preview - # packages. - # @!attribute [rw] unversioned_package_disabled - # @return [::Boolean] - # Disables generation of an unversioned Python package for this client - # library. This means that the module names will need to be versioned in - # import statements. For example `import google.cloud.library_v2` instead - # of `import google.cloud.library`. - class ExperimentalFeatures - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Node client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class NodeSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Dotnet client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from original service names to renamed versions. - # This is used when the default generated types - # would cause a naming conflict. (Neither name is - # fully-qualified.) - # Example: Subscriber to SubscriberServiceApi. - # @!attribute [rw] renamed_resources - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from full resource types to the effective short name - # for the resource. This is used when otherwise resource - # named from different services would cause naming collisions. - # Example entry: - # "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - # @!attribute [rw] ignored_resources - # @return [::Array<::String>] - # List of full resource types to ignore during generation. - # This is typically used for API-specific Location resources, - # which should be handled by the generator as if they were actually - # the common Location resources. - # Example entry: "documentai.googleapis.com/Location" - # @!attribute [rw] forced_namespace_aliases - # @return [::Array<::String>] - # Namespaces which must be aliased in snippets due to - # a known (but non-generator-predictable) naming collision - # @!attribute [rw] handwritten_signatures - # @return [::Array<::String>] - # Method signatures (in the form "service.method(signature)") - # which are provided separately, so shouldn't be generated. - # Snippets *calling* these methods are still generated, however. - class DotnetSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedResourcesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Settings for Ruby client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - class RubySettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Settings for Go client libraries. - # @!attribute [rw] common - # @return [::Google::Api::CommonLanguageSettings] - # Some settings. - # @!attribute [rw] renamed_services - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map of service names to renamed services. Keys are the package relative - # service names and values are the name to be used for the service client - # and call options. - # - # publishing: - # go_settings: - # renamed_services: - # Publisher: TopicAdmin - class GoSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class RenamedServicesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the generator configuration for a method. - # @!attribute [rw] selector - # @return [::String] - # The fully qualified name of the method, for which the options below apply. - # This is used to find the method to apply the options. - # - # Example: - # - # publishing: - # method_settings: - # - selector: google.storage.control.v2.StorageControl.CreateFolder - # # method settings for CreateFolder... - # @!attribute [rw] long_running - # @return [::Google::Api::MethodSettings::LongRunning] - # Describes settings to use for long-running operations when generating - # API methods for RPCs. Complements RPCs that use the annotations in - # google/longrunning/operations.proto. - # - # Example of a YAML configuration:: - # - # publishing: - # method_settings: - # - selector: google.cloud.speech.v2.Speech.BatchRecognize - # long_running: - # initial_poll_delay: 60s # 1 minute - # poll_delay_multiplier: 1.5 - # max_poll_delay: 360s # 6 minutes - # total_poll_timeout: 54000s # 90 minutes - # @!attribute [rw] auto_populated_fields - # @return [::Array<::String>] - # List of top-level fields of the request message, that should be - # automatically populated by the client libraries based on their - # (google.api.field_info).format. Currently supported format: UUID4. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.CreateExample - # auto_populated_fields: - # - request_id - class MethodSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes settings to use when generating API methods that use the - # long-running operation pattern. - # All default values below are from those used in the client library - # generators (e.g. - # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - # @!attribute [rw] initial_poll_delay - # @return [::Google::Protobuf::Duration] - # Initial delay after which the first poll request will be made. - # Default value: 5 seconds. - # @!attribute [rw] poll_delay_multiplier - # @return [::Float] - # Multiplier to gradually increase delay between subsequent polls until it - # reaches max_poll_delay. - # Default value: 1.5. - # @!attribute [rw] max_poll_delay - # @return [::Google::Protobuf::Duration] - # Maximum time between two subsequent poll requests. - # Default value: 45 seconds. - # @!attribute [rw] total_poll_timeout - # @return [::Google::Protobuf::Duration] - # Total polling timeout. - # Default value: 5 minutes. - class LongRunning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # This message is used to configure the generation of a subset of the RPCs in - # a service for client libraries. - # @!attribute [rw] methods - # @return [::Array<::String>] - # An allowlist of the fully qualified names of RPCs that should be included - # on public client surfaces. - # @!attribute [rw] generate_omitted_as_internal - # @return [::Boolean] - # Setting this to true indicates to the client generators that methods - # that would be excluded from the generation should instead be generated - # in a way that indicates these methods should not be consumed by - # end users. How this is expressed is up to individual language - # implementations to decide. Some examples may be: added annotations, - # obfuscated identifiers, or other language idiomatic patterns. - class SelectiveGapicGeneration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The organization for which the client libraries are being published. - # Affects the url where generated docs are published, etc. - module ClientLibraryOrganization - # Not useful. - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 - - # Google Cloud Platform Org. - CLOUD = 1 - - # Ads (Advertising) Org. - ADS = 2 - - # Photos Org. - PHOTOS = 3 - - # Street View Org. - STREET_VIEW = 4 - - # Shopping Org. - SHOPPING = 5 - - # Geo Org. - GEO = 6 - - # Generative AI - https://developers.generativeai.google - GENERATIVE_AI = 7 - end - - # To where should client libraries be published? - module ClientLibraryDestination - # Client libraries will neither be generated nor published to package - # managers. - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 - - # Generate the client library in a repo under github.com/googleapis, - # but don't publish it to package managers. - GITHUB = 10 - - # Publish the library to package managers like nuget.org and npmjs.com. - PACKAGE_MANAGER = 20 - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_behavior.rb +++ /dev/null @@ -1,85 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module 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-storage-control-v2/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/field_info.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module 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-storage-control-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/launch_stage.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module 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-storage-control-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/resource.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module 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-storage-control-v2/proto_docs/google/api/routing.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/routing.rb deleted file mode 100644 index d777329024e7..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/api/routing.rb +++ /dev/null @@ -1,459 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Specifies the routing information that should be sent along with the request - # in the form of routing header. - # **NOTE:** All service configuration rules follow the "last one wins" order. - # - # The examples below will apply to an RPC which has the following request type: - # - # Message Definition: - # - # message Request { - # // The name of the Table - # // Values can be of the following formats: - # // - `projects//tables/
` - # // - `projects//instances//tables/
` - # // - `region//zones//tables/
` - # string table_name = 1; - # - # // This value specifies routing for replication. - # // It can be in the following formats: - # // - `profiles/` - # // - a legacy `profile_id` that can be any string - # string app_profile_id = 2; - # } - # - # Example message: - # - # { - # table_name: projects/proj_foo/instances/instance_bar/table/table_baz, - # app_profile_id: profiles/prof_qux - # } - # - # The routing header consists of one or multiple key-value pairs. Every key - # and value must be percent-encoded, and joined together in the format of - # `key1=value1&key2=value2`. - # The examples below skip the percent-encoding for readability. - # - # Example 1 - # - # Extracting a field from the request to put into the routing header - # unchanged, with the key equal to the field name. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `app_profile_id`. - # routing_parameters { - # field: "app_profile_id" - # } - # }; - # - # result: - # - # x-goog-request-params: app_profile_id=profiles/prof_qux - # - # Example 2 - # - # Extracting a field from the request to put into the routing header - # unchanged, with the key different from the field name. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `app_profile_id`, but name it `routing_id` in the header. - # routing_parameters { - # field: "app_profile_id" - # path_template: "{routing_id=**}" - # } - # }; - # - # result: - # - # x-goog-request-params: routing_id=profiles/prof_qux - # - # Example 3 - # - # Extracting a field from the request to put into the routing - # header, while matching a path template syntax on the field's value. - # - # NB: it is more useful to send nothing than to send garbage for the purpose - # of dynamic routing, since garbage pollutes cache. Thus the matching. - # - # Sub-example 3a - # - # The field matches the template. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `table_name`, if it's well-formed (with project-based - # // syntax). - # routing_parameters { - # field: "table_name" - # path_template: "{table_name=projects/*/instances/*/**}" - # } - # }; - # - # result: - # - # x-goog-request-params: - # table_name=projects/proj_foo/instances/instance_bar/table/table_baz - # - # Sub-example 3b - # - # The field does not match the template. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `table_name`, if it's well-formed (with region-based - # // syntax). - # routing_parameters { - # field: "table_name" - # path_template: "{table_name=regions/*/zones/*/**}" - # } - # }; - # - # result: - # - # - # - # Sub-example 3c - # - # Multiple alternative conflictingly named path templates are - # specified. The one that matches is used to construct the header. - # - # annotation: - # - # option (google.api.routing) = { - # // Take the `table_name`, if it's well-formed, whether - # // using the region- or projects-based syntax. - # - # routing_parameters { - # field: "table_name" - # path_template: "{table_name=regions/*/zones/*/**}" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{table_name=projects/*/instances/*/**}" - # } - # }; - # - # result: - # - # x-goog-request-params: - # table_name=projects/proj_foo/instances/instance_bar/table/table_baz - # - # Example 4 - # - # Extracting a single routing header key-value pair by matching a - # template syntax on (a part of) a single request field. - # - # annotation: - # - # option (google.api.routing) = { - # // Take just the project id from the `table_name` field. - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*}/**" - # } - # }; - # - # result: - # - # x-goog-request-params: routing_id=projects/proj_foo - # - # Example 5 - # - # Extracting a single routing header key-value pair by matching - # several conflictingly named path templates on (parts of) a single request - # field. The last template to match "wins" the conflict. - # - # annotation: - # - # option (google.api.routing) = { - # // If the `table_name` does not have instances information, - # // take just the project id for routing. - # // Otherwise take project + instance. - # - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*}/**" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*/instances/*}/**" - # } - # }; - # - # result: - # - # x-goog-request-params: - # routing_id=projects/proj_foo/instances/instance_bar - # - # Example 6 - # - # Extracting multiple routing header key-value pairs by matching - # several non-conflicting path templates on (parts of) a single request field. - # - # Sub-example 6a - # - # Make the templates strict, so that if the `table_name` does not - # have an instance information, nothing is sent. - # - # annotation: - # - # option (google.api.routing) = { - # // The routing code needs two keys instead of one composite - # // but works only for the tables with the "project-instance" name - # // syntax. - # - # routing_parameters { - # field: "table_name" - # path_template: "{project_id=projects/*}/instances/*/**" - # } - # routing_parameters { - # field: "table_name" - # path_template: "projects/*/{instance_id=instances/*}/**" - # } - # }; - # - # result: - # - # x-goog-request-params: - # project_id=projects/proj_foo&instance_id=instances/instance_bar - # - # Sub-example 6b - # - # Make the templates loose, so that if the `table_name` does not - # have an instance information, just the project id part is sent. - # - # annotation: - # - # option (google.api.routing) = { - # // The routing code wants two keys instead of one composite - # // but will work with just the `project_id` for tables without - # // an instance in the `table_name`. - # - # routing_parameters { - # field: "table_name" - # path_template: "{project_id=projects/*}/**" - # } - # routing_parameters { - # field: "table_name" - # path_template: "projects/*/{instance_id=instances/*}/**" - # } - # }; - # - # result (is the same as 6a for our example message because it has the instance - # information): - # - # x-goog-request-params: - # project_id=projects/proj_foo&instance_id=instances/instance_bar - # - # Example 7 - # - # Extracting multiple routing header key-value pairs by matching - # several path templates on multiple request fields. - # - # NB: note that here there is no way to specify sending nothing if one of the - # fields does not match its template. E.g. if the `table_name` is in the wrong - # format, the `project_id` will not be sent, but the `routing_id` will be. - # The backend routing code has to be aware of that and be prepared to not - # receive a full complement of keys if it expects multiple. - # - # annotation: - # - # option (google.api.routing) = { - # // The routing needs both `project_id` and `routing_id` - # // (from the `app_profile_id` field) for routing. - # - # routing_parameters { - # field: "table_name" - # path_template: "{project_id=projects/*}/**" - # } - # routing_parameters { - # field: "app_profile_id" - # path_template: "{routing_id=**}" - # } - # }; - # - # result: - # - # x-goog-request-params: - # project_id=projects/proj_foo&routing_id=profiles/prof_qux - # - # Example 8 - # - # Extracting a single routing header key-value pair by matching - # several conflictingly named path templates on several request fields. The - # last template to match "wins" the conflict. - # - # annotation: - # - # option (google.api.routing) = { - # // The `routing_id` can be a project id or a region id depending on - # // the table name format, but only if the `app_profile_id` is not set. - # // If `app_profile_id` is set it should be used instead. - # - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*}/**" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=regions/*}/**" - # } - # routing_parameters { - # field: "app_profile_id" - # path_template: "{routing_id=**}" - # } - # }; - # - # result: - # - # x-goog-request-params: routing_id=profiles/prof_qux - # - # Example 9 - # - # Bringing it all together. - # - # annotation: - # - # option (google.api.routing) = { - # // For routing both `table_location` and a `routing_id` are needed. - # // - # // table_location can be either an instance id or a region+zone id. - # // - # // For `routing_id`, take the value of `app_profile_id` - # // - If it's in the format `profiles/`, send - # // just the `` part. - # // - If it's any other literal, send it as is. - # // If the `app_profile_id` is empty, and the `table_name` starts with - # // the project_id, send that instead. - # - # routing_parameters { - # field: "table_name" - # path_template: "projects/*/{table_location=instances/*}/tables/*" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{table_location=regions/*/zones/*}/tables/*" - # } - # routing_parameters { - # field: "table_name" - # path_template: "{routing_id=projects/*}/**" - # } - # routing_parameters { - # field: "app_profile_id" - # path_template: "{routing_id=**}" - # } - # routing_parameters { - # field: "app_profile_id" - # path_template: "profiles/{routing_id=*}" - # } - # }; - # - # result: - # - # x-goog-request-params: - # table_location=instances/instance_bar&routing_id=prof_qux - # @!attribute [rw] routing_parameters - # @return [::Array<::Google::Api::RoutingParameter>] - # A collection of Routing Parameter specifications. - # **NOTE:** If multiple Routing Parameters describe the same key - # (via the `path_template` field or via the `field` field when - # `path_template` is not provided), "last one wins" rule - # determines which Parameter gets used. - # See the examples for more details. - class RoutingRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A projection from an input message to the GRPC or REST header. - # @!attribute [rw] field - # @return [::String] - # A request field to extract the header key-value pair from. - # @!attribute [rw] path_template - # @return [::String] - # A pattern matching the key-value field. Optional. - # If not specified, the whole field specified in the `field` field will be - # taken as value, and its name used as key. If specified, it MUST contain - # exactly one named segment (along with any number of unnamed segments) The - # pattern will be matched over the field specified in the `field` field, then - # if the match is successful: - # - the name of the single named segment will be used as a header name, - # - the match value of the segment will be used as a header value; - # if the match is NOT successful, nothing will be sent. - # - # Example: - # - # -- This is a field in the request message - # | that the header value will be extracted from. - # | - # | -- This is the key name in the - # | | routing header. - # V | - # field: "table_name" v - # path_template: "projects/*/{table_location=instances/*}/tables/*" - # ^ ^ - # | | - # In the {} brackets is the pattern that -- | - # specifies what to extract from the | - # field as a value to be sent. | - # | - # The string in the field must match the whole pattern -- - # before brackets, inside brackets, after brackets. - # - # When looking at this specific example, we can see that: - # - A key-value pair with the key `table_location` - # and the value matching `instances/*` should be added - # to the x-goog-request-params routing header. - # - The value is extracted from the request message's `table_name` field - # if it matches the full pattern specified: - # `projects/*/instances/*/tables/*`. - # - # **NB:** If the `path_template` field is not provided, the key name is - # equal to the field name, and the whole field should be sent as a value. - # This makes the pattern for the field and the value functionally equivalent - # to `**`, and the configuration - # - # { - # field: "table_name" - # } - # - # is a functionally equivalent shorthand to: - # - # { - # field: "table_name" - # path_template: "{table_name=**}" - # } - # - # See Example 1 for more details. - class RoutingParameter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module 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-storage-control-v2/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module 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-storage-control-v2/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module 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. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. 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`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - 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. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - 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. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - 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 Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!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-storage-control-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module 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-storage-control-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/duration.rb +++ /dev/null @@ -1,98 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module 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-storage-control-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/empty.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module 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-storage-control-v2/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/field_mask.rb +++ /dev/null @@ -1,229 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module 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-storage-control-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/protobuf/timestamp.rb +++ /dev/null @@ -1,127 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module 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-storage-control-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module 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-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb deleted file mode 100644 index 6ab7a9a20ea8..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/storage/control/v2/storage_control.rb +++ /dev/null @@ -1,1026 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Cloud - module Storage - module Control - module V2 - # Contains information about a pending rename operation. - # @!attribute [r] operation - # @return [::String] - # Output only. The name of the rename operation. - class PendingRenameInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A folder resource. This resource can only exist in a hierarchical namespace - # enabled bucket. - # @!attribute [rw] name - # @return [::String] - # Identifier. The name of this folder. - # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` - # @!attribute [r] metageneration - # @return [::Integer] - # Output only. The version of the metadata for this folder. Used for - # preconditions and for detecting changes in metadata. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The creation time of the folder. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The modification time of the folder. - # @!attribute [r] pending_rename_info - # @return [::Google::Cloud::Storage::Control::V2::PendingRenameInfo] - # Output only. Only present if the folder is part of an ongoing RenameFolder - # operation. Contains information which can be used to query the operation - # status. The presence of this field also indicates all write operations are - # blocked for this folder, including folder, managed folder, and object - # operations. - class Folder - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetFolder. This operation is only applicable to a - # hierarchical namespace enabled bucket. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the folder. - # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` - # @!attribute [rw] if_metageneration_match - # @return [::Integer] - # Makes the operation only succeed conditional on whether the folder's - # current metageneration matches the given value. - # @!attribute [rw] if_metageneration_not_match - # @return [::Integer] - # Makes the operation only succeed conditional on whether the folder's - # current metageneration does not match the given value. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class GetFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateFolder. This operation is only applicable to a - # hierarchical namespace enabled bucket. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the bucket in which the folder will reside. The bucket - # must be a hierarchical namespace enabled bucket. - # @!attribute [rw] folder - # @return [::Google::Cloud::Storage::Control::V2::Folder] - # Required. Properties of the new folder being created. - # The bucket and name of the folder are specified in the parent and folder_id - # fields, respectively. Populating those fields in `folder` will result in an - # error. - # @!attribute [rw] folder_id - # @return [::String] - # Required. The full name of a folder, including all its parent folders. - # Folders use single '/' characters as a delimiter. - # The folder_id must end with a slash. - # For example, the folder_id of "books/biographies/" would create a new - # "biographies/" folder under the "books/" folder. - # @!attribute [rw] recursive - # @return [::Boolean] - # Optional. If true, parent folder doesn't have to be present and all missing - # ancestor folders will be created atomically. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class CreateFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteFolder. This operation is only applicable to a - # hierarchical namespace enabled bucket. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the folder. - # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` - # @!attribute [rw] if_metageneration_match - # @return [::Integer] - # Makes the operation only succeed conditional on whether the folder's - # current metageneration matches the given value. - # @!attribute [rw] if_metageneration_not_match - # @return [::Integer] - # Makes the operation only succeed conditional on whether the folder's - # current metageneration does not match the given value. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class DeleteFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListFolders. This operation is only applicable to a - # hierarchical namespace enabled bucket. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the bucket in which to look for folders. The bucket must - # be a hierarchical namespace enabled bucket. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of folders to return in a single response. The - # service will use this parameter or 1,000 items, whichever is smaller. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A previously-returned page token representing part of the larger - # set of results to view. - # @!attribute [rw] prefix - # @return [::String] - # Optional. Filter results to folders whose names begin with this prefix. - # If set, the value must either be an empty string or end with a '/'. - # @!attribute [rw] delimiter - # @return [::String] - # Optional. If set, returns results in a directory-like mode. The results - # will only include folders that either exactly match the above prefix, or - # are one level below the prefix. The only supported value is '/'. - # @!attribute [rw] lexicographic_start - # @return [::String] - # Optional. Filter results to folders whose names are lexicographically equal - # to or after lexicographic_start. If lexicographic_end is also set, the - # folders listed have names between lexicographic_start (inclusive) and - # lexicographic_end (exclusive). - # @!attribute [rw] lexicographic_end - # @return [::String] - # Optional. Filter results to folders whose names are lexicographically - # before lexicographic_end. If lexicographic_start is also set, the folders - # listed have names between lexicographic_start (inclusive) and - # lexicographic_end (exclusive). - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class ListFoldersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListFolders. - # @!attribute [rw] folders - # @return [::Array<::Google::Cloud::Storage::Control::V2::Folder>] - # The list of child folders - # @!attribute [rw] next_page_token - # @return [::String] - # The continuation token, used to page through large result sets. Provide - # this value in a subsequent request to return the next page of results. - class ListFoldersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for RenameFolder. This operation is only applicable to a - # hierarchical namespace enabled bucket. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the source folder being renamed. - # Format: `projects/{project}/buckets/{bucket}/folders/{folder}` - # @!attribute [rw] destination_folder_id - # @return [::String] - # Required. The destination folder ID, e.g. `foo/bar/`. - # @!attribute [rw] if_metageneration_match - # @return [::Integer] - # Makes the operation only succeed conditional on whether the source - # folder's current metageneration matches the given value. - # @!attribute [rw] if_metageneration_not_match - # @return [::Integer] - # Makes the operation only succeed conditional on whether the source - # folder's current metageneration does not match the given value. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - class RenameFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteFolderRecursive. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the folder being deleted, however all of its contents - # will be deleted too. Format: - # `projects/{project}/buckets/{bucket}/folders/{folder}` - # @!attribute [rw] if_metageneration_match - # @return [::Integer] - # Optional. Makes the operation only succeed conditional on whether the root - # folder's current metageneration matches the given value. - # @!attribute [rw] if_metageneration_not_match - # @return [::Integer] - # Optional. Makes the operation only succeed conditional on whether the root - # folder's current metageneration does not match the given value. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class DeleteFolderRecursiveRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The message contains metadata that is common to all Storage Control - # long-running operations, present in its `google.longrunning.Operation` - # messages, and accessible via `metadata.common_metadata`. - # @!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] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation was last modified. - # @!attribute [r] type - # @return [::String] - # Output only. The type of operation invoked. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation. - # @!attribute [r] progress_percent - # @return [::Integer] - # Output only. The estimated progress of the operation in percentage [0, - # 100]. The value -1 means the progress is unknown. - class CommonLongRunningOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message returned in the metadata field of the Operation resource for - # RenameFolder operations. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] - # Generic metadata for the long running operation. - # @!attribute [rw] source_folder_id - # @return [::String] - # The path of the source folder. - # @!attribute [rw] destination_folder_id - # @return [::String] - # The path of the destination folder. - class RenameFolderMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message returned in the metadata field of the Operation resource for - # DeleteFolderRecursive operations. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] - # Generic metadata for the long running operation. - # @!attribute [rw] folder_id - # @return [::String] - # The path of the folder recursively deleted. - class DeleteFolderRecursiveMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The storage layout configuration of a bucket. - # @!attribute [r] name - # @return [::String] - # Output only. The name of the StorageLayout resource. - # Format: `projects/{project}/buckets/{bucket}/storageLayout` - # @!attribute [r] location - # @return [::String] - # Output only. The location of the bucket. - # @!attribute [r] location_type - # @return [::String] - # Output only. The location type of the bucket (region, dual-region, - # multi-region, etc). - # @!attribute [r] custom_placement_config - # @return [::Google::Cloud::Storage::Control::V2::StorageLayout::CustomPlacementConfig] - # Output only. The data placement configuration for custom dual region. If - # there is no configuration, this is not a custom dual region bucket. - # @!attribute [r] hierarchical_namespace - # @return [::Google::Cloud::Storage::Control::V2::StorageLayout::HierarchicalNamespace] - # Output only. The bucket's hierarchical namespace configuration. If there is - # no configuration, the hierarchical namespace is disabled. - class StorageLayout - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration for Custom Dual Regions. It should specify precisely two - # eligible regions within the same Multiregion. More information on regions - # may be found [here](https://cloud.google.com/storage/docs/locations). - # @!attribute [rw] data_locations - # @return [::Array<::String>] - # List of locations to use for data placement. - class CustomPlacementConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for a bucket's hierarchical namespace feature. - # @!attribute [rw] enabled - # @return [::Boolean] - # Enables the hierarchical namespace feature. - class HierarchicalNamespace - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for GetStorageLayout. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the StorageLayout resource. - # Format: `projects/{project}/buckets/{bucket}/storageLayout` - # @!attribute [rw] prefix - # @return [::String] - # An optional prefix used for permission check. It is useful when the caller - # only has limited permissions under a specific prefix. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class GetStorageLayoutRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A managed folder. - # @!attribute [rw] name - # @return [::String] - # Identifier. The name of this managed folder. - # Format: - # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` - # @!attribute [r] metageneration - # @return [::Integer] - # Output only. The metadata version of this managed folder. It increases - # whenever the metadata is updated. Used for preconditions and for detecting - # changes in metadata. Managed folders don't have a generation number. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The creation time of the managed folder. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The modification time of the managed folder. - class ManagedFolder - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetManagedFolder. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the managed folder. - # Format: - # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` - # @!attribute [rw] if_metageneration_match - # @return [::Integer] - # The operation succeeds conditional on the managed folder's current - # metageneration matching the value here specified. - # @!attribute [rw] if_metageneration_not_match - # @return [::Integer] - # The operation succeeds conditional on the managed folder's current - # metageneration NOT matching the value here specified. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class GetManagedFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateManagedFolder. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the bucket this managed folder belongs to. - # @!attribute [rw] managed_folder - # @return [::Google::Cloud::Storage::Control::V2::ManagedFolder] - # Required. Properties of the managed folder being created. - # The bucket and managed folder names are specified in the `parent` and - # `managed_folder_id` fields. Populating these fields in `managed_folder` - # will result in an error. - # @!attribute [rw] managed_folder_id - # @return [::String] - # Required. The name of the managed folder. It uses a single `/` as delimiter - # and leading and trailing `/` are allowed. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class CreateManagedFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # DeleteManagedFolder RPC request message. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the managed folder. - # Format: - # `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}` - # @!attribute [rw] if_metageneration_match - # @return [::Integer] - # The operation succeeds conditional on the managed folder's current - # metageneration matching the value here specified. - # @!attribute [rw] if_metageneration_not_match - # @return [::Integer] - # The operation succeeds conditional on the managed folder's current - # metageneration NOT matching the value here specified. - # @!attribute [rw] allow_non_empty - # @return [::Boolean] - # Allows deletion of a managed folder even if it is not empty. - # A managed folder is empty if it manages no child managed folders or - # objects. Caller must have permission for - # storage.managedFolders.setIamPolicy. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class DeleteManagedFolderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListManagedFolders. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the bucket this managed folder belongs to. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of managed folders to return in a single response. - # The service will use this parameter or 1,000 items, whichever is smaller. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A previously-returned page token representing part of the larger - # set of results to view. - # @!attribute [rw] prefix - # @return [::String] - # Optional. Filter results to match managed folders with name starting with - # this prefix. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class ListManagedFoldersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListManagedFolders. - # @!attribute [rw] managed_folders - # @return [::Array<::Google::Cloud::Storage::Control::V2::ManagedFolder>] - # The list of matching managed folders - # @!attribute [rw] next_page_token - # @return [::String] - # The continuation token, used to page through large result sets. Provide - # this value in a subsequent request to return the next page of results. - class ListManagedFoldersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message returned in the metadata field of the Operation resource for - # CreateAnywhereCache operations. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] - # Generic metadata for the long running operation. - # @!attribute [rw] anywhere_cache_id - # @return [::String] - # Anywhere Cache ID. - # @!attribute [rw] zone - # @return [::String] - # The zone in which the cache instance is running. For example, - # us-central1-a. - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # Anywhere Cache entry's TTL. A cache-level config that is applied to all new - # cache entries on admission. Default ttl value (24hrs) is applied if not - # specified in the create request. - # @!attribute [rw] admission_policy - # @return [::String] - # Anywhere Cache entry Admission Policy in kebab-case (e.g., - # "admit-on-first-miss"). Default admission policy (admit-on-first-miss) is - # applied if not specified in the create request. - class CreateAnywhereCacheMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message returned in the metadata field of the Operation resource for - # UpdateAnywhereCache operation. - # @!attribute [rw] common_metadata - # @return [::Google::Cloud::Storage::Control::V2::CommonLongRunningOperationMetadata] - # Generic metadata for the long running operation. - # @!attribute [rw] anywhere_cache_id - # @return [::String] - # Anywhere Cache ID. - # @!attribute [rw] zone - # @return [::String] - # The zone in which the cache instance is running. For example, - # us-central1-a. - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # Anywhere Cache entry's TTL between 1h and 7days. A cache-level config that - # is applied to all new cache entries on admission. If `ttl` is pending - # update, this field equals to the new value specified in the Update request. - # @!attribute [rw] admission_policy - # @return [::String] - # L4 Cache entry Admission Policy in kebab-case (e.g., - # "admit-on-first-miss"). If `admission_policy` is pending - # update, this field equals to the new value specified in the Update request. - class UpdateAnywhereCacheMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An Anywhere Cache Instance. - # @!attribute [rw] name - # @return [::String] - # Immutable. The resource name of this AnywhereCache. - # Format: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @!attribute [rw] zone - # @return [::String] - # Immutable. The zone in which the cache instance is running. For example, - # us-central1-a. - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # Cache entry TTL (ranges between 1h to 7d). This is a cache-level config - # that defines how long a cache entry can live. Default ttl value (24hrs) - # is applied if not specified in the create request. TTL must be in whole - # seconds. - # @!attribute [rw] admission_policy - # @return [::String] - # Cache admission policy. Valid policies includes: - # `admit-on-first-miss` and `admit-on-second-miss`. Defaults to - # `admit-on-first-miss`. Default value is applied if not specified in the - # create request. - # @!attribute [r] state - # @return [::String] - # Output only. Cache state including RUNNING, CREATING, DISABLED and PAUSED. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when Anywhere cache instance is allocated. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when Anywhere cache instance is last updated, including - # creation. - # @!attribute [r] pending_update - # @return [::Boolean] - # Output only. True if there is an active update operation against this cache - # instance. Subsequential update requests will be rejected if this field is - # true. Output only. - class AnywhereCache - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateAnywhereCache. - # @!attribute [rw] parent - # @return [::String] - # Required. The bucket to which this cache belongs. - # Format: `projects/{project}/buckets/{bucket}` - # @!attribute [rw] anywhere_cache - # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # Required. Properties of the Anywhere Cache instance being created. - # The parent bucket name is specified in the `parent` field. Server uses the - # default value of `ttl` or `admission_policy` if not specified in - # request. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - class CreateAnywhereCacheRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateAnywhereCache. - # @!attribute [rw] anywhere_cache - # @return [::Google::Cloud::Storage::Control::V2::AnywhereCache] - # Required. The Anywhere Cache instance to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. List of fields to be updated. Mutable fields of AnywhereCache - # include `ttl` and `admission_policy`. - # - # To specify ALL fields, specify a single field with the value `*`. Note: We - # recommend against doing this. If a new field is introduced at a later time, - # an older client updating with the `*` may accidentally reset the new - # field's value. - # - # Not specifying any fields is an error. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - class UpdateAnywhereCacheRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DisableAnywhereCache. - # @!attribute [rw] name - # @return [::String] - # Required. The name field in the request should be: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - class DisableAnywhereCacheRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for PauseAnywhereCache. - # @!attribute [rw] name - # @return [::String] - # Required. The name field in the request should be: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - class PauseAnywhereCacheRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ResumeAnywhereCache. - # @!attribute [rw] name - # @return [::String] - # Required. The name field in the request should be: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. This request is only - # idempotent if a `request_id` is provided. - class ResumeAnywhereCacheRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetAnywhereCache. - # @!attribute [rw] name - # @return [::String] - # Required. The name field in the request should be: - # `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class GetAnywhereCacheRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListAnywhereCaches. - # @!attribute [rw] parent - # @return [::String] - # Required. The bucket to which this cache belongs. - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of caches to return in a single response. - # The service will use this parameter or 1,000 items, whichever is smaller. - # @!attribute [rw] page_token - # @return [::String] - # A previously-returned page token representing part of the larger set of - # results to view. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A unique identifier for this request. UUID is the recommended - # format, but other formats are still accepted. - class ListAnywhereCachesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListAnywhereCaches. - # @!attribute [rw] anywhere_caches - # @return [::Array<::Google::Cloud::Storage::Control::V2::AnywhereCache>] - # The list of items. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListAnywhereCachesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The `IntelligenceConfig` resource associated with your organization, folder, - # or project. - # @!attribute [rw] name - # @return [::String] - # Identifier. The name of the `IntelligenceConfig` resource associated with - # your organization, folder, or project. - # - # The name format varies based on the GCP resource hierarchy as follows: - # - # * For project: - # `projects/{project_number}/locations/global/intelligenceConfig` - # * For organization: - # `organizations/{org_id}/locations/global/intelligenceConfig` - # * For folder: `folders/{folder_id}/locations/global/intelligenceConfig` - # @!attribute [rw] edition_config - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::EditionConfig] - # Optional. The edition configuration of the `IntelligenceConfig` resource. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the `IntelligenceConfig` resource is last - # updated. - # @!attribute [rw] filter - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter] - # Optional. Filter over location and bucket. - # @!attribute [r] effective_intelligence_config - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::EffectiveIntelligenceConfig] - # Output only. The `IntelligenceConfig` resource that is applicable for the - # resource. - # @!attribute [rw] trial_config - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::TrialConfig] - # The trial configuration of the `IntelligenceConfig` resource. - class IntelligenceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Filter over location and bucket using include or exclude semantics. - # Resources that match the include or exclude filter are exclusively included - # or excluded from the Storage Intelligence plan. - # @!attribute [rw] included_cloud_storage_locations - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter::CloudStorageLocations] - # Bucket locations to include. - # - # Note: The following fields are mutually exclusive: `included_cloud_storage_locations`, `excluded_cloud_storage_locations`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] excluded_cloud_storage_locations - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter::CloudStorageLocations] - # Bucket locations to exclude. - # - # Note: The following fields are mutually exclusive: `excluded_cloud_storage_locations`, `included_cloud_storage_locations`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] included_cloud_storage_buckets - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter::CloudStorageBuckets] - # Buckets to include. - # - # Note: The following fields are mutually exclusive: `included_cloud_storage_buckets`, `excluded_cloud_storage_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] excluded_cloud_storage_buckets - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::Filter::CloudStorageBuckets] - # Buckets to exclude. - # - # Note: The following fields are mutually exclusive: `excluded_cloud_storage_buckets`, `included_cloud_storage_buckets`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Filter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Collection of bucket locations. - # @!attribute [rw] locations - # @return [::Array<::String>] - # Optional. Bucket locations. Location can be any of the Cloud Storage - # regions specified in lower case format. For example, `us-east1`, - # `us-west1`. - class CloudStorageLocations - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Collection of buckets. - # @!attribute [rw] bucket_id_regexes - # @return [::Array<::String>] - # Optional. A regex pattern for matching bucket names. Regex should - # follow the syntax specified in - # [google/re2](https://github.com/google/re2). For example, - # `^sample_.*` matches all buckets of the form - # `gs://sample_bucket-1`, `gs://sample_bucket-2`, - # `gs://sample_bucket-n` but not `gs://test_sample_bucket`. - # If you want to match a single bucket, say `gs://sample_bucket`, - # use `sample_bucket`. - class CloudStorageBuckets - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The effective `IntelligenceConfig` for the resource. - # @!attribute [r] effective_edition - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig::EffectiveIntelligenceConfig::EffectiveEdition] - # Output only. The `IntelligenceConfig` edition that is applicable for the - # resource. - # @!attribute [r] intelligence_config - # @return [::String] - # Output only. The `IntelligenceConfig` resource that is applied for the - # target resource. Format: - # `{organizations|folders|projects}/{id}/locations/{location}/intelligenceConfig` - class EffectiveIntelligenceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The effective edition of the `IntelligenceConfig` resource. - module EffectiveEdition - # This is an unknown edition of the resource. - EFFECTIVE_EDITION_UNSPECIFIED = 0 - - # No edition. - NONE = 1 - - # The `IntelligenceConfig` resource is of STANDARD edition. - STANDARD = 2 - end - end - - # The trial configuration of the `IntelligenceConfig` resource. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the trial expires. - class TrialConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The edition configuration of the `IntelligenceConfig` resource. This - # signifies the edition used for configuring the `IntelligenceConfig` - # resource and can only take the following values: - # `EDITION_CONFIG_UNSPECIFIED`, `INHERIT`, `DISABLED`, `STANDARD` and - # `TRIAL`. - module EditionConfig - # This is an unknown edition of the resource. - EDITION_CONFIG_UNSPECIFIED = 0 - - # The inherited edition from the parent and filters. This is the default - # edition when there is no `IntelligenceConfig` setup for a GCP resource. - INHERIT = 1 - - # The edition configuration is disabled for the `IntelligenceConfig` - # resource and its children. Filters are not applicable. - DISABLED = 2 - - # The `IntelligenceConfig` resource is of STANDARD edition. - STANDARD = 3 - - # The `IntelligenceConfig` resource is available in `TRIAL` edition. During - # the trial period, Cloud Storage does not charge for Storage Intelligence - # usage. You can specify the buckets to include in the trial period by - # using filters. At the end of the trial period, the `IntelligenceConfig` - # resource is upgraded to `STANDARD` edition. - TRIAL = 5 - end - end - - # Request message to update the `IntelligenceConfig` resource associated with - # your organization. - # - # **IAM Permissions**: - # - # Requires `storage.intelligenceConfigs.update` - # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on - # the organization. - # @!attribute [rw] intelligence_config - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # Required. The `IntelligenceConfig` resource to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @!attribute [rw] request_id - # @return [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - class UpdateOrganizationIntelligenceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to update the `IntelligenceConfig` resource associated with - # your folder. - # - # **IAM Permissions**: - # - # Requires `storage.intelligenceConfigs.update` - # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on - # the folder. - # @!attribute [rw] intelligence_config - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # Required. The `IntelligenceConfig` resource to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @!attribute [rw] request_id - # @return [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - class UpdateFolderIntelligenceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to update the `IntelligenceConfig` resource associated with - # your project. - # - # **IAM Permissions**: - # - # Requires `storage.intelligenceConfigs.update` - # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on - # the folder. - # @!attribute [rw] intelligence_config - # @return [::Google::Cloud::Storage::Control::V2::IntelligenceConfig] - # Required. The `IntelligenceConfig` resource to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The `update_mask` that specifies the fields within the - # `IntelligenceConfig` resource that should be modified by this update. Only - # the listed fields are updated. - # @!attribute [rw] request_id - # @return [::String] - # Optional. The ID that uniquely identifies the request, preventing duplicate - # processing. - class UpdateProjectIntelligenceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to get the `IntelligenceConfig` resource associated with your - # organization. - # - # **IAM Permissions** - # - # Requires `storage.intelligenceConfigs.get` - # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on - # the organization. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your organization. - # - # Format: `organizations/{org_id}/locations/global/intelligenceConfig` - class GetOrganizationIntelligenceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to get the `IntelligenceConfig` resource associated with your - # folder. - # - # **IAM Permissions** - # - # Requires `storage.intelligenceConfigs.get` - # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on - # the folder. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your folder. - # - # Format: `folders/{id}/locations/global/intelligenceConfig` - class GetFolderIntelligenceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message to get the `IntelligenceConfig` resource associated with your - # project. - # - # **IAM Permissions**: - # - # Requires `storage.intelligenceConfigs.get` - # [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission - # on the project. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the `IntelligenceConfig` resource associated with - # your project. - # - # Format: `projects/{id}/locations/global/intelligenceConfig` - class GetProjectIntelligenceConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/proto_docs/google/type/expr.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module 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-storage-control-v2/snippets/Gemfile b/owl-bot-staging/google-cloud-storage-control-v2/snippets/Gemfile deleted file mode 100644 index 2d9a5aa92db0..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/Gemfile +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -source "https://rubygems.org" - -if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-cloud-storage-control-v2", path: "../" -else - gem "google-cloud-storage-control-v2" -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-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json b/owl-bot-staging/google-cloud-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json deleted file mode 100644 index 79b7fb355379..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/snippet_metadata_google.storage.control.v2.json +++ /dev/null @@ -1,1095 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-storage-control-v2", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.storage.control.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "region_tag": "storage_v2_generated_StorageControl_CreateFolder_sync", - "title": "Snippet for the create_folder call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#create_folder.", - "file": "storage_control/create_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_folder", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#create_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::CreateFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::Folder", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "CreateFolder", - "full_name": "google.storage.control.v2.StorageControl.CreateFolder", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_DeleteFolder_sync", - "title": "Snippet for the delete_folder call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder.", - "file": "storage_control/delete_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_folder", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::DeleteFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "DeleteFolder", - "full_name": "google.storage.control.v2.StorageControl.DeleteFolder", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_GetFolder_sync", - "title": "Snippet for the get_folder call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder.", - "file": "storage_control/get_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_folder", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::GetFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::Folder", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "GetFolder", - "full_name": "google.storage.control.v2.StorageControl.GetFolder", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_ListFolders_sync", - "title": "Snippet for the list_folders call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#list_folders.", - "file": "storage_control/list_folders.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_folders", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#list_folders", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::ListFoldersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::ListFoldersResponse", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "ListFolders", - "full_name": "google.storage.control.v2.StorageControl.ListFolders", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_RenameFolder_sync", - "title": "Snippet for the rename_folder call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#rename_folder.", - "file": "storage_control/rename_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "rename_folder", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#rename_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::RenameFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "RenameFolder", - "full_name": "google.storage.control.v2.StorageControl.RenameFolder", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_DeleteFolderRecursive_sync", - "title": "Snippet for the delete_folder_recursive call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder_recursive.", - "file": "storage_control/delete_folder_recursive.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_folder_recursive", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_folder_recursive", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "DeleteFolderRecursive", - "full_name": "google.storage.control.v2.StorageControl.DeleteFolderRecursive", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_GetStorageLayout_sync", - "title": "Snippet for the get_storage_layout call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_storage_layout.", - "file": "storage_control/get_storage_layout.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_storage_layout", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_storage_layout", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::StorageLayout", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "GetStorageLayout", - "full_name": "google.storage.control.v2.StorageControl.GetStorageLayout", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_CreateManagedFolder_sync", - "title": "Snippet for the create_managed_folder call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#create_managed_folder.", - "file": "storage_control/create_managed_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_managed_folder", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#create_managed_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::ManagedFolder", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "CreateManagedFolder", - "full_name": "google.storage.control.v2.StorageControl.CreateManagedFolder", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_DeleteManagedFolder_sync", - "title": "Snippet for the delete_managed_folder call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_managed_folder.", - "file": "storage_control/delete_managed_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_managed_folder", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#delete_managed_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "DeleteManagedFolder", - "full_name": "google.storage.control.v2.StorageControl.DeleteManagedFolder", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_GetManagedFolder_sync", - "title": "Snippet for the get_managed_folder call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_managed_folder.", - "file": "storage_control/get_managed_folder.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_managed_folder", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_managed_folder", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::ManagedFolder", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "GetManagedFolder", - "full_name": "google.storage.control.v2.StorageControl.GetManagedFolder", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_ListManagedFolders_sync", - "title": "Snippet for the list_managed_folders call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#list_managed_folders.", - "file": "storage_control/list_managed_folders.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_managed_folders", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#list_managed_folders", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::ListManagedFoldersResponse", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "ListManagedFolders", - "full_name": "google.storage.control.v2.StorageControl.ListManagedFolders", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_CreateAnywhereCache_sync", - "title": "Snippet for the create_anywhere_cache call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#create_anywhere_cache.", - "file": "storage_control/create_anywhere_cache.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_anywhere_cache", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#create_anywhere_cache", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "CreateAnywhereCache", - "full_name": "google.storage.control.v2.StorageControl.CreateAnywhereCache", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_UpdateAnywhereCache_sync", - "title": "Snippet for the update_anywhere_cache call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#update_anywhere_cache.", - "file": "storage_control/update_anywhere_cache.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_anywhere_cache", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#update_anywhere_cache", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "UpdateAnywhereCache", - "full_name": "google.storage.control.v2.StorageControl.UpdateAnywhereCache", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_DisableAnywhereCache_sync", - "title": "Snippet for the disable_anywhere_cache call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#disable_anywhere_cache.", - "file": "storage_control/disable_anywhere_cache.rb", - "language": "RUBY", - "client_method": { - "short_name": "disable_anywhere_cache", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#disable_anywhere_cache", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::AnywhereCache", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "DisableAnywhereCache", - "full_name": "google.storage.control.v2.StorageControl.DisableAnywhereCache", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_PauseAnywhereCache_sync", - "title": "Snippet for the pause_anywhere_cache call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#pause_anywhere_cache.", - "file": "storage_control/pause_anywhere_cache.rb", - "language": "RUBY", - "client_method": { - "short_name": "pause_anywhere_cache", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#pause_anywhere_cache", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::AnywhereCache", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "PauseAnywhereCache", - "full_name": "google.storage.control.v2.StorageControl.PauseAnywhereCache", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_ResumeAnywhereCache_sync", - "title": "Snippet for the resume_anywhere_cache call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#resume_anywhere_cache.", - "file": "storage_control/resume_anywhere_cache.rb", - "language": "RUBY", - "client_method": { - "short_name": "resume_anywhere_cache", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#resume_anywhere_cache", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::AnywhereCache", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "ResumeAnywhereCache", - "full_name": "google.storage.control.v2.StorageControl.ResumeAnywhereCache", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_GetAnywhereCache_sync", - "title": "Snippet for the get_anywhere_cache call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_anywhere_cache.", - "file": "storage_control/get_anywhere_cache.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_anywhere_cache", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_anywhere_cache", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::AnywhereCache", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "GetAnywhereCache", - "full_name": "google.storage.control.v2.StorageControl.GetAnywhereCache", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_ListAnywhereCaches_sync", - "title": "Snippet for the list_anywhere_caches call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#list_anywhere_caches.", - "file": "storage_control/list_anywhere_caches.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_anywhere_caches", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#list_anywhere_caches", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::ListAnywhereCachesResponse", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "ListAnywhereCaches", - "full_name": "google.storage.control.v2.StorageControl.ListAnywhereCaches", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_GetProjectIntelligenceConfig_sync", - "title": "Snippet for the get_project_intelligence_config call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_project_intelligence_config.", - "file": "storage_control/get_project_intelligence_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_project_intelligence_config", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_project_intelligence_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "GetProjectIntelligenceConfig", - "full_name": "google.storage.control.v2.StorageControl.GetProjectIntelligenceConfig", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_UpdateProjectIntelligenceConfig_sync", - "title": "Snippet for the update_project_intelligence_config call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#update_project_intelligence_config.", - "file": "storage_control/update_project_intelligence_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_project_intelligence_config", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#update_project_intelligence_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "UpdateProjectIntelligenceConfig", - "full_name": "google.storage.control.v2.StorageControl.UpdateProjectIntelligenceConfig", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_GetFolderIntelligenceConfig_sync", - "title": "Snippet for the get_folder_intelligence_config call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder_intelligence_config.", - "file": "storage_control/get_folder_intelligence_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_folder_intelligence_config", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_folder_intelligence_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "GetFolderIntelligenceConfig", - "full_name": "google.storage.control.v2.StorageControl.GetFolderIntelligenceConfig", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_UpdateFolderIntelligenceConfig_sync", - "title": "Snippet for the update_folder_intelligence_config call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#update_folder_intelligence_config.", - "file": "storage_control/update_folder_intelligence_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_folder_intelligence_config", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#update_folder_intelligence_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "UpdateFolderIntelligenceConfig", - "full_name": "google.storage.control.v2.StorageControl.UpdateFolderIntelligenceConfig", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_GetOrganizationIntelligenceConfig_sync", - "title": "Snippet for the get_organization_intelligence_config call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_organization_intelligence_config.", - "file": "storage_control/get_organization_intelligence_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_organization_intelligence_config", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_organization_intelligence_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "GetOrganizationIntelligenceConfig", - "full_name": "google.storage.control.v2.StorageControl.GetOrganizationIntelligenceConfig", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_UpdateOrganizationIntelligenceConfig_sync", - "title": "Snippet for the update_organization_intelligence_config call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#update_organization_intelligence_config.", - "file": "storage_control/update_organization_intelligence_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_organization_intelligence_config", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#update_organization_intelligence_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Storage::Control::V2::IntelligenceConfig", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "UpdateOrganizationIntelligenceConfig", - "full_name": "google.storage.control.v2.StorageControl.UpdateOrganizationIntelligenceConfig", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#get_iam_policy.", - "file": "storage_control/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.storage.control.v2.StorageControl.GetIamPolicy", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#set_iam_policy.", - "file": "storage_control/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.storage.control.v2.StorageControl.SetIamPolicy", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "storage_v2_generated_StorageControl_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the StorageControl service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Storage::Control::V2::StorageControl::Client#test_iam_permissions.", - "file": "storage_control/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "StorageControl::Client", - "full_name": "::Google::Cloud::Storage::Control::V2::StorageControl::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.storage.control.v2.StorageControl.TestIamPermissions", - "service": { - "short_name": "StorageControl", - "full_name": "google.storage.control.v2.StorageControl" - } - } - }, - "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-storage-control-v2/snippets/storage_control/create_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_anywhere_cache.rb deleted file mode 100644 index bbd8060b1bd0..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_anywhere_cache.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_CreateAnywhereCache_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the create_anywhere_cache call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#create_anywhere_cache. -# -def create_anywhere_cache - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new - - # Call the create_anywhere_cache method. - result = client.create_anywhere_cache 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 storage_v2_generated_StorageControl_CreateAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_folder.rb deleted file mode 100644 index dd92a948086e..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_folder.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_CreateFolder_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the create_folder call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#create_folder. -# -def create_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::CreateFolderRequest.new - - # Call the create_folder method. - result = client.create_folder request - - # The returned object is of type Google::Cloud::Storage::Control::V2::Folder. - p result -end -# [END storage_v2_generated_StorageControl_CreateFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_managed_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_managed_folder.rb deleted file mode 100644 index e1fb93270c88..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/create_managed_folder.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_CreateManagedFolder_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the create_managed_folder call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#create_managed_folder. -# -def create_managed_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest.new - - # Call the create_managed_folder method. - result = client.create_managed_folder request - - # The returned object is of type Google::Cloud::Storage::Control::V2::ManagedFolder. - p result -end -# [END storage_v2_generated_StorageControl_CreateManagedFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder.rb deleted file mode 100644 index 6527be8b6351..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_folder.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_DeleteFolder_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the delete_folder call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#delete_folder. -# -def delete_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new - - # Call the delete_folder method. - result = client.delete_folder request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END storage_v2_generated_StorageControl_DeleteFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_managed_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_managed_folder.rb deleted file mode 100644 index cc6a608ab87f..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/delete_managed_folder.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_DeleteManagedFolder_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the delete_managed_folder call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#delete_managed_folder. -# -def delete_managed_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest.new - - # Call the delete_managed_folder method. - result = client.delete_managed_folder request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END storage_v2_generated_StorageControl_DeleteManagedFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/disable_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/disable_anywhere_cache.rb deleted file mode 100644 index c2a2b8e4c3b7..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/disable_anywhere_cache.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_DisableAnywhereCache_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the disable_anywhere_cache call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#disable_anywhere_cache. -# -def disable_anywhere_cache - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new - - # Call the disable_anywhere_cache method. - result = client.disable_anywhere_cache request - - # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. - p result -end -# [END storage_v2_generated_StorageControl_DisableAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_anywhere_cache.rb deleted file mode 100644 index e71ce4780d7a..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_anywhere_cache.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_GetAnywhereCache_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the get_anywhere_cache call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#get_anywhere_cache. -# -def get_anywhere_cache - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new - - # Call the get_anywhere_cache method. - result = client.get_anywhere_cache request - - # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. - p result -end -# [END storage_v2_generated_StorageControl_GetAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder.rb deleted file mode 100644 index a48c2019212e..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_GetFolder_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the get_folder call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#get_folder. -# -def get_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::GetFolderRequest.new - - # Call the get_folder method. - result = client.get_folder request - - # The returned object is of type Google::Cloud::Storage::Control::V2::Folder. - p result -end -# [END storage_v2_generated_StorageControl_GetFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder_intelligence_config.rb deleted file mode 100644 index dad8ed93e7ba..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_folder_intelligence_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_GetFolderIntelligenceConfig_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the get_folder_intelligence_config call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#get_folder_intelligence_config. -# -def get_folder_intelligence_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new - - # Call the get_folder_intelligence_config method. - result = client.get_folder_intelligence_config request - - # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - p result -end -# [END storage_v2_generated_StorageControl_GetFolderIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_iam_policy.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_iam_policy.rb deleted file mode 100644 index 349e334e7668..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_GetIamPolicy_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the get_iam_policy call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::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 storage_v2_generated_StorageControl_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_managed_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_managed_folder.rb deleted file mode 100644 index 4456c65ead42..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_managed_folder.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_GetManagedFolder_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the get_managed_folder call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#get_managed_folder. -# -def get_managed_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::GetManagedFolderRequest.new - - # Call the get_managed_folder method. - result = client.get_managed_folder request - - # The returned object is of type Google::Cloud::Storage::Control::V2::ManagedFolder. - p result -end -# [END storage_v2_generated_StorageControl_GetManagedFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_organization_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_organization_intelligence_config.rb deleted file mode 100644 index 3843e092f909..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_organization_intelligence_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_GetOrganizationIntelligenceConfig_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the get_organization_intelligence_config call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#get_organization_intelligence_config. -# -def get_organization_intelligence_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new - - # Call the get_organization_intelligence_config method. - result = client.get_organization_intelligence_config request - - # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - p result -end -# [END storage_v2_generated_StorageControl_GetOrganizationIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_project_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_project_intelligence_config.rb deleted file mode 100644 index 63b47d76f5ce..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_project_intelligence_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_GetProjectIntelligenceConfig_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the get_project_intelligence_config call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#get_project_intelligence_config. -# -def get_project_intelligence_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new - - # Call the get_project_intelligence_config method. - result = client.get_project_intelligence_config request - - # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - p result -end -# [END storage_v2_generated_StorageControl_GetProjectIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_storage_layout.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_storage_layout.rb deleted file mode 100644 index b032cc0443a7..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/get_storage_layout.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_GetStorageLayout_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the get_storage_layout call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#get_storage_layout. -# -def get_storage_layout - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new - - # Call the get_storage_layout method. - result = client.get_storage_layout request - - # The returned object is of type Google::Cloud::Storage::Control::V2::StorageLayout. - p result -end -# [END storage_v2_generated_StorageControl_GetStorageLayout_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_anywhere_caches.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_anywhere_caches.rb deleted file mode 100644 index 125771ab1c46..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_anywhere_caches.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_ListAnywhereCaches_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the list_anywhere_caches call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#list_anywhere_caches. -# -def list_anywhere_caches - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new - - # Call the list_anywhere_caches method. - result = client.list_anywhere_caches 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::Storage::Control::V2::AnywhereCache. - p item - end -end -# [END storage_v2_generated_StorageControl_ListAnywhereCaches_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_folders.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_folders.rb deleted file mode 100644 index a14428976afa..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_folders.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_ListFolders_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the list_folders call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#list_folders. -# -def list_folders - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::ListFoldersRequest.new - - # Call the list_folders method. - result = client.list_folders 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::Storage::Control::V2::Folder. - p item - end -end -# [END storage_v2_generated_StorageControl_ListFolders_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_managed_folders.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_managed_folders.rb deleted file mode 100644 index 199fdd2fb572..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/list_managed_folders.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_ListManagedFolders_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the list_managed_folders call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#list_managed_folders. -# -def list_managed_folders - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest.new - - # Call the list_managed_folders method. - result = client.list_managed_folders 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::Storage::Control::V2::ManagedFolder. - p item - end -end -# [END storage_v2_generated_StorageControl_ListManagedFolders_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/pause_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/pause_anywhere_cache.rb deleted file mode 100644 index ba92a11e170d..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/pause_anywhere_cache.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_PauseAnywhereCache_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the pause_anywhere_cache call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#pause_anywhere_cache. -# -def pause_anywhere_cache - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new - - # Call the pause_anywhere_cache method. - result = client.pause_anywhere_cache request - - # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. - p result -end -# [END storage_v2_generated_StorageControl_PauseAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/rename_folder.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/rename_folder.rb deleted file mode 100644 index f44abdfe039b..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/rename_folder.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_RenameFolder_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the rename_folder call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#rename_folder. -# -def rename_folder - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::RenameFolderRequest.new - - # Call the rename_folder method. - result = client.rename_folder 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 storage_v2_generated_StorageControl_RenameFolder_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/resume_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/resume_anywhere_cache.rb deleted file mode 100644 index 4302ff5de677..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/resume_anywhere_cache.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_ResumeAnywhereCache_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the resume_anywhere_cache call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#resume_anywhere_cache. -# -def resume_anywhere_cache - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new - - # Call the resume_anywhere_cache method. - result = client.resume_anywhere_cache request - - # The returned object is of type Google::Cloud::Storage::Control::V2::AnywhereCache. - p result -end -# [END storage_v2_generated_StorageControl_ResumeAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/set_iam_policy.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/set_iam_policy.rb deleted file mode 100644 index e73a4d5d1de2..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/set_iam_policy.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_SetIamPolicy_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the set_iam_policy call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::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 storage_v2_generated_StorageControl_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/test_iam_permissions.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/test_iam_permissions.rb deleted file mode 100644 index 485086025053..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/test_iam_permissions.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_TestIamPermissions_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the test_iam_permissions call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::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 storage_v2_generated_StorageControl_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_anywhere_cache.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_anywhere_cache.rb deleted file mode 100644 index 57d4f56505f4..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_anywhere_cache.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_UpdateAnywhereCache_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the update_anywhere_cache call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#update_anywhere_cache. -# -def update_anywhere_cache - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new - - # Call the update_anywhere_cache method. - result = client.update_anywhere_cache 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 storage_v2_generated_StorageControl_UpdateAnywhereCache_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_folder_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_folder_intelligence_config.rb deleted file mode 100644 index c44d13080aa2..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_folder_intelligence_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_UpdateFolderIntelligenceConfig_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the update_folder_intelligence_config call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#update_folder_intelligence_config. -# -def update_folder_intelligence_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new - - # Call the update_folder_intelligence_config method. - result = client.update_folder_intelligence_config request - - # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - p result -end -# [END storage_v2_generated_StorageControl_UpdateFolderIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_organization_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_organization_intelligence_config.rb deleted file mode 100644 index 150381470100..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_organization_intelligence_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_UpdateOrganizationIntelligenceConfig_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the update_organization_intelligence_config call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#update_organization_intelligence_config. -# -def update_organization_intelligence_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new - - # Call the update_organization_intelligence_config method. - result = client.update_organization_intelligence_config request - - # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - p result -end -# [END storage_v2_generated_StorageControl_UpdateOrganizationIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_project_intelligence_config.rb b/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_project_intelligence_config.rb deleted file mode 100644 index 56d206d78ff1..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/snippets/storage_control/update_project_intelligence_config.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START storage_v2_generated_StorageControl_UpdateProjectIntelligenceConfig_sync] -require "google/cloud/storage/control/v2" - -## -# Snippet for the update_project_intelligence_config call in the StorageControl 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::Storage::Control::V2::StorageControl::Client#update_project_intelligence_config. -# -def update_project_intelligence_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Storage::Control::V2::StorageControl::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new - - # Call the update_project_intelligence_config method. - result = client.update_project_intelligence_config request - - # The returned object is of type Google::Cloud::Storage::Control::V2::IntelligenceConfig. - p result -end -# [END storage_v2_generated_StorageControl_UpdateProjectIntelligenceConfig_sync] diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_operations_test.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_operations_test.rb deleted file mode 100644 index 39b7bd9a10d3..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/storage/control/v2/storage_control_pb" -require "google/storage/control/v2/storage_control_services_pb" -require "google/cloud/storage/control/v2/storage_control" - -class ::Google::Cloud::Storage::Control::V2::StorageControl::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) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_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" - return_partial_success = true - - 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"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::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, return_partial_success: return_partial_success }) 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, return_partial_success: return_partial_success 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, return_partial_success: return_partial_success) 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, return_partial_success: return_partial_success }, 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, return_partial_success: return_partial_success), 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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_paths_test.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_paths_test.rb deleted file mode 100644 index 77eb67a52960..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_paths_test.rb +++ /dev/null @@ -1,121 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/storage/control/v2/storage_control" - -class ::Google::Cloud::Storage::Control::V2::StorageControl::ClientPathsTest < Minitest::Test - class DummyStub - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_anywhere_cache_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.anywhere_cache_path project: "value0", bucket: "value1", anywhere_cache: "value2" - assert_equal "projects/value0/buckets/value1/anywhereCaches/value2", path - end - end - - def test_bucket_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.bucket_path project: "value0", bucket: "value1" - assert_equal "projects/value0/buckets/value1", path - end - end - - def test_folder_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.folder_path project: "value0", bucket: "value1", folder: "value2" - assert_equal "projects/value0/buckets/value1/folders/value2", path - end - end - - def test_intelligence_config_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.intelligence_config_path folder: "value0", location: "value1" - assert_equal "folders/value0/locations/value1/intelligenceConfig", path - - path = client.intelligence_config_path org: "value0", location: "value1" - assert_equal "organizations/value0/locations/value1/intelligenceConfig", path - - path = client.intelligence_config_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/intelligenceConfig", path - end - end - - def test_managed_folder_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.managed_folder_path project: "value0", bucket: "value1", managed_folder: "value2" - assert_equal "projects/value0/buckets/value1/managedFolders/value2", path - end - end - - def test_storage_layout_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.storage_layout_path project: "value0", bucket: "value1" - assert_equal "projects/value0/buckets/value1/storageLayout", path - end - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_rest_test.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_rest_test.rb deleted file mode 100644 index e8890b18eec3..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_rest_test.rb +++ /dev/null @@ -1,429 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" -require "gapic/rest" -require "google/storage/control/v2/storage_control_pb" -require "google/cloud/storage/control/v2/storage_control/rest" - - -class ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_count, :requests - - def initialize response, &block - @response = response - @block = block - @call_count = 0 - @requests = [] - end - - def make_get_request uri:, params: {}, options: {}, method_name: nil - make_http_request :get, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_delete_request uri:, params: {}, options: {}, method_name: nil - make_http_request :delete, uri: uri, body: nil, params: params, options: options, method_name: method_name - end - - def make_post_request uri:, body: nil, params: {}, options: {}, method_name: nil - make_http_request :post, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_patch_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :patch, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_put_request uri:, body:, params: {}, options: {}, method_name: nil - make_http_request :put, uri: uri, body: body, params: params, options: options, method_name: method_name - end - - def make_http_request *args, **kwargs - @call_count += 1 - - @requests << @block&.call(*args, **kwargs) - - @response - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_get_project_intelligence_config - # Create test objects. - client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_project_intelligence_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_get_project_intelligence_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_project_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_project_intelligence_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_project_intelligence_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_project_intelligence_config ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_project_intelligence_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_project_intelligence_config(::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_project_intelligence_config_client_stub.call_count - end - end - end - - def test_update_project_intelligence_config - # Create test objects. - client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - intelligence_config = {} - update_mask = {} - request_id = "hello world" - - update_project_intelligence_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_update_project_intelligence_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_project_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_project_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_project_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_project_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_project_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_project_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_project_intelligence_config_client_stub.call_count - end - end - end - - def test_get_folder_intelligence_config - # Create test objects. - client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_folder_intelligence_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_get_folder_intelligence_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_folder_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_folder_intelligence_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_folder_intelligence_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_folder_intelligence_config ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_folder_intelligence_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_folder_intelligence_config(::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_folder_intelligence_config_client_stub.call_count - end - end - end - - def test_update_folder_intelligence_config - # Create test objects. - client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - intelligence_config = {} - update_mask = {} - request_id = "hello world" - - update_folder_intelligence_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_update_folder_intelligence_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_folder_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_folder_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_folder_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_folder_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_folder_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_folder_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_folder_intelligence_config_client_stub.call_count - end - end - end - - def test_get_organization_intelligence_config - # Create test objects. - client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_organization_intelligence_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_get_organization_intelligence_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_organization_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_organization_intelligence_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_organization_intelligence_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_organization_intelligence_config ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_organization_intelligence_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_organization_intelligence_config(::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_organization_intelligence_config_client_stub.call_count - end - end - end - - def test_update_organization_intelligence_config - # Create test objects. - client_result = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - intelligence_config = {} - update_mask = {} - request_id = "hello world" - - update_organization_intelligence_config_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::ServiceStub.stub :transcode_update_organization_intelligence_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_organization_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_organization_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_organization_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_organization_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_organization_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_organization_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_organization_intelligence_config_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::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb deleted file mode 100644 index d85897291ac9..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/test/google/cloud/storage/control/v2/storage_control_test.rb +++ /dev/null @@ -1,1853 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/storage/control/v2/storage_control_pb" -require "google/cloud/storage/control/v2/storage_control" - -class ::Google::Cloud::Storage::Control::V2::StorageControl::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_folder - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::Folder.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" - folder = {} - folder_id = "hello world" - recursive = true - request_id = "hello world" - - create_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_folder, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::CreateFolderRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::Folder), request["folder"] - assert_equal "hello world", request["folder_id"] - assert_equal true, request["recursive"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_folder_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_folder({ parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_folder parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_folder ::Google::Cloud::Storage::Control::V2::CreateFolderRequest.new(parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, 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_folder({ parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, 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_folder(::Google::Cloud::Storage::Control::V2::CreateFolderRequest.new(parent: parent, folder: folder, folder_id: folder_id, recursive: recursive, 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_folder_client_stub.call_rpc_count - end - end - - def test_delete_folder - # 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" - if_metageneration_match = 42 - if_metageneration_not_match = 42 - request_id = "hello world" - - delete_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_folder, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["if_metageneration_match"] - assert request.has_if_metageneration_match? - assert_equal 42, request["if_metageneration_not_match"] - assert request.has_if_metageneration_not_match? - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_folder_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_folder name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_folder ::Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.delete_folder(::Google::Cloud::Storage::Control::V2::DeleteFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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, delete_folder_client_stub.call_rpc_count - end - end - - def test_get_folder - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::Folder.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" - if_metageneration_match = 42 - if_metageneration_not_match = 42 - request_id = "hello world" - - get_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_folder, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::GetFolderRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["if_metageneration_match"] - assert request.has_if_metageneration_match? - assert_equal 42, request["if_metageneration_not_match"] - assert request.has_if_metageneration_not_match? - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_folder_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_folder name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_folder ::Google::Cloud::Storage::Control::V2::GetFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.get_folder(::Google::Cloud::Storage::Control::V2::GetFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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, get_folder_client_stub.call_rpc_count - end - end - - def test_list_folders - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::ListFoldersResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - prefix = "hello world" - delimiter = "hello world" - lexicographic_start = "hello world" - lexicographic_end = "hello world" - request_id = "hello world" - - list_folders_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_folders, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::ListFoldersRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["prefix"] - assert_equal "hello world", request["delimiter"] - assert_equal "hello world", request["lexicographic_start"] - assert_equal "hello world", request["lexicographic_end"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_folders_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_folders({ parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id }) 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_folders parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id 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_folders ::Google::Cloud::Storage::Control::V2::ListFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id) 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_folders({ parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id }, 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_folders(::Google::Cloud::Storage::Control::V2::ListFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, delimiter: delimiter, lexicographic_start: lexicographic_start, lexicographic_end: lexicographic_end, request_id: request_id), 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_folders_client_stub.call_rpc_count - end - end - - def test_rename_folder - # 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" - destination_folder_id = "hello world" - if_metageneration_match = 42 - if_metageneration_not_match = 42 - request_id = "hello world" - - rename_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :rename_folder, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::RenameFolderRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["destination_folder_id"] - assert_equal 42, request["if_metageneration_match"] - assert request.has_if_metageneration_match? - assert_equal 42, request["if_metageneration_not_match"] - assert request.has_if_metageneration_not_match? - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, rename_folder_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.rename_folder({ name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.rename_folder name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.rename_folder ::Google::Cloud::Storage::Control::V2::RenameFolderRequest.new(name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.rename_folder({ name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.rename_folder(::Google::Cloud::Storage::Control::V2::RenameFolderRequest.new(name: name, destination_folder_id: destination_folder_id, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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, rename_folder_client_stub.call_rpc_count - end - end - - def test_delete_folder_recursive - # 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" - if_metageneration_match = 42 - if_metageneration_not_match = 42 - request_id = "hello world" - - delete_folder_recursive_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_folder_recursive, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["if_metageneration_match"] - assert request.has_if_metageneration_match? - assert_equal 42, request["if_metageneration_not_match"] - assert request.has_if_metageneration_not_match? - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_folder_recursive_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_folder_recursive({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive ::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive(::Google::Cloud::Storage::Control::V2::DeleteFolderRecursiveRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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_folder_recursive_client_stub.call_rpc_count - end - end - - def test_get_storage_layout - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::StorageLayout.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" - prefix = "hello world" - request_id = "hello world" - - get_storage_layout_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_storage_layout, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["prefix"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_storage_layout_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_storage_layout({ name: name, prefix: prefix, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_storage_layout name: name, prefix: prefix, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_storage_layout ::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new(name: name, prefix: prefix, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_storage_layout({ name: name, prefix: prefix, 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.get_storage_layout(::Google::Cloud::Storage::Control::V2::GetStorageLayoutRequest.new(name: name, prefix: prefix, 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, get_storage_layout_client_stub.call_rpc_count - end - end - - def test_create_managed_folder - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::ManagedFolder.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" - managed_folder = {} - managed_folder_id = "hello world" - request_id = "hello world" - - create_managed_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_managed_folder, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::ManagedFolder), request["managed_folder"] - assert_equal "hello world", request["managed_folder_id"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_managed_folder_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_managed_folder({ parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_managed_folder parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_managed_folder ::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest.new(parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, 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_managed_folder({ parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, 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_managed_folder(::Google::Cloud::Storage::Control::V2::CreateManagedFolderRequest.new(parent: parent, managed_folder: managed_folder, managed_folder_id: managed_folder_id, 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_managed_folder_client_stub.call_rpc_count - end - end - - def test_delete_managed_folder - # 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" - if_metageneration_match = 42 - if_metageneration_not_match = 42 - allow_non_empty = true - request_id = "hello world" - - delete_managed_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_managed_folder, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["if_metageneration_match"] - assert request.has_if_metageneration_match? - assert_equal 42, request["if_metageneration_not_match"] - assert request.has_if_metageneration_not_match? - assert_equal true, request["allow_non_empty"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_managed_folder_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_managed_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_managed_folder name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_managed_folder ::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_managed_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, 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.delete_managed_folder(::Google::Cloud::Storage::Control::V2::DeleteManagedFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, allow_non_empty: allow_non_empty, 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, delete_managed_folder_client_stub.call_rpc_count - end - end - - def test_get_managed_folder - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::ManagedFolder.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" - if_metageneration_match = 42 - if_metageneration_not_match = 42 - request_id = "hello world" - - get_managed_folder_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_managed_folder, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["if_metageneration_match"] - assert request.has_if_metageneration_match? - assert_equal 42, request["if_metageneration_not_match"] - assert request.has_if_metageneration_not_match? - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_managed_folder_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_managed_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_managed_folder name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_managed_folder ::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_managed_folder({ name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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.get_managed_folder(::Google::Cloud::Storage::Control::V2::GetManagedFolderRequest.new(name: name, if_metageneration_match: if_metageneration_match, if_metageneration_not_match: if_metageneration_not_match, 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, get_managed_folder_client_stub.call_rpc_count - end - end - - def test_list_managed_folders - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::ListManagedFoldersResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - prefix = "hello world" - request_id = "hello world" - - list_managed_folders_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_managed_folders, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["prefix"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_managed_folders_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_managed_folders({ parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id }) 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_managed_folders parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id 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_managed_folders ::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id) 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_managed_folders({ parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id }, 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_managed_folders(::Google::Cloud::Storage::Control::V2::ListManagedFoldersRequest.new(parent: parent, page_size: page_size, page_token: page_token, prefix: prefix, request_id: request_id), 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_managed_folders_client_stub.call_rpc_count - end - end - - def test_create_anywhere_cache - # 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. - parent = "hello world" - anywhere_cache = {} - request_id = "hello world" - - create_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_anywhere_cache, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::AnywhereCache), request["anywhere_cache"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_anywhere_cache_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_anywhere_cache({ parent: parent, anywhere_cache: anywhere_cache, 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.create_anywhere_cache parent: parent, anywhere_cache: anywhere_cache, 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.create_anywhere_cache ::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new(parent: parent, anywhere_cache: anywhere_cache, 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.create_anywhere_cache({ parent: parent, anywhere_cache: anywhere_cache, 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.create_anywhere_cache(::Google::Cloud::Storage::Control::V2::CreateAnywhereCacheRequest.new(parent: parent, anywhere_cache: anywhere_cache, 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, create_anywhere_cache_client_stub.call_rpc_count - end - end - - def test_update_anywhere_cache - # 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. - anywhere_cache = {} - update_mask = {} - request_id = "hello world" - - update_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_anywhere_cache, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::AnywhereCache), request["anywhere_cache"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_anywhere_cache_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_anywhere_cache({ anywhere_cache: anywhere_cache, update_mask: update_mask, 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.update_anywhere_cache anywhere_cache: anywhere_cache, update_mask: update_mask, 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.update_anywhere_cache ::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new(anywhere_cache: anywhere_cache, update_mask: update_mask, 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.update_anywhere_cache({ anywhere_cache: anywhere_cache, update_mask: update_mask, 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.update_anywhere_cache(::Google::Cloud::Storage::Control::V2::UpdateAnywhereCacheRequest.new(anywhere_cache: anywhere_cache, update_mask: update_mask, 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, update_anywhere_cache_client_stub.call_rpc_count - end - end - - def test_disable_anywhere_cache - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::AnywhereCache.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" - request_id = "hello world" - - disable_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :disable_anywhere_cache, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, disable_anywhere_cache_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.disable_anywhere_cache({ name: name, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.disable_anywhere_cache name: name, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.disable_anywhere_cache ::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new(name: name, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.disable_anywhere_cache({ name: name, 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.disable_anywhere_cache(::Google::Cloud::Storage::Control::V2::DisableAnywhereCacheRequest.new(name: name, 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, disable_anywhere_cache_client_stub.call_rpc_count - end - end - - def test_pause_anywhere_cache - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::AnywhereCache.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" - request_id = "hello world" - - pause_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :pause_anywhere_cache, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, pause_anywhere_cache_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.pause_anywhere_cache({ name: name, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.pause_anywhere_cache name: name, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.pause_anywhere_cache ::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new(name: name, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.pause_anywhere_cache({ name: name, 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.pause_anywhere_cache(::Google::Cloud::Storage::Control::V2::PauseAnywhereCacheRequest.new(name: name, 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, pause_anywhere_cache_client_stub.call_rpc_count - end - end - - def test_resume_anywhere_cache - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::AnywhereCache.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" - request_id = "hello world" - - resume_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resume_anywhere_cache, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, resume_anywhere_cache_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resume_anywhere_cache({ name: name, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.resume_anywhere_cache name: name, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.resume_anywhere_cache ::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new(name: name, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.resume_anywhere_cache({ name: name, 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.resume_anywhere_cache(::Google::Cloud::Storage::Control::V2::ResumeAnywhereCacheRequest.new(name: name, 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, resume_anywhere_cache_client_stub.call_rpc_count - end - end - - def test_get_anywhere_cache - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::AnywhereCache.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" - request_id = "hello world" - - get_anywhere_cache_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_anywhere_cache, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_anywhere_cache_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_anywhere_cache({ name: name, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_anywhere_cache name: name, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_anywhere_cache ::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new(name: name, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_anywhere_cache({ name: name, 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.get_anywhere_cache(::Google::Cloud::Storage::Control::V2::GetAnywhereCacheRequest.new(name: name, 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, get_anywhere_cache_client_stub.call_rpc_count - end - end - - def test_list_anywhere_caches - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - request_id = "hello world" - - list_anywhere_caches_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_anywhere_caches, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_anywhere_caches_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_anywhere_caches({ parent: parent, page_size: page_size, page_token: page_token, request_id: request_id }) 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_anywhere_caches parent: parent, page_size: page_size, page_token: page_token, request_id: request_id 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_anywhere_caches ::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new(parent: parent, page_size: page_size, page_token: page_token, request_id: request_id) 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_anywhere_caches({ parent: parent, page_size: page_size, page_token: page_token, request_id: request_id }, 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_anywhere_caches(::Google::Cloud::Storage::Control::V2::ListAnywhereCachesRequest.new(parent: parent, page_size: page_size, page_token: page_token, request_id: request_id), 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_anywhere_caches_client_stub.call_rpc_count - end - end - - def test_get_project_intelligence_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.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_project_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_project_intelligence_config, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_project_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_project_intelligence_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_project_intelligence_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_project_intelligence_config ::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_project_intelligence_config({ 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_project_intelligence_config(::Google::Cloud::Storage::Control::V2::GetProjectIntelligenceConfigRequest.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_project_intelligence_config_client_stub.call_rpc_count - end - end - - def test_update_project_intelligence_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.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. - intelligence_config = {} - update_mask = {} - request_id = "hello world" - - update_project_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_project_intelligence_config, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::IntelligenceConfig), request["intelligence_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_project_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_project_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_project_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_project_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_project_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, 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.update_project_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateProjectIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, 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, update_project_intelligence_config_client_stub.call_rpc_count - end - end - - def test_get_folder_intelligence_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.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_folder_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_folder_intelligence_config, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_folder_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_folder_intelligence_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_folder_intelligence_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_folder_intelligence_config ::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_folder_intelligence_config({ 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_folder_intelligence_config(::Google::Cloud::Storage::Control::V2::GetFolderIntelligenceConfigRequest.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_folder_intelligence_config_client_stub.call_rpc_count - end - end - - def test_update_folder_intelligence_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.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. - intelligence_config = {} - update_mask = {} - request_id = "hello world" - - update_folder_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_folder_intelligence_config, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::IntelligenceConfig), request["intelligence_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_folder_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_folder_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_folder_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_folder_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_folder_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, 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.update_folder_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateFolderIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, 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, update_folder_intelligence_config_client_stub.call_rpc_count - end - end - - def test_get_organization_intelligence_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.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_organization_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_organization_intelligence_config, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_organization_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_organization_intelligence_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_organization_intelligence_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_organization_intelligence_config ::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_organization_intelligence_config({ 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_organization_intelligence_config(::Google::Cloud::Storage::Control::V2::GetOrganizationIntelligenceConfigRequest.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_organization_intelligence_config_client_stub.call_rpc_count - end - end - - def test_update_organization_intelligence_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Storage::Control::V2::IntelligenceConfig.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. - intelligence_config = {} - update_mask = {} - request_id = "hello world" - - update_organization_intelligence_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_organization_intelligence_config, name - assert_kind_of ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Storage::Control::V2::IntelligenceConfig), request["intelligence_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_organization_intelligence_config_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_organization_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_organization_intelligence_config intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_organization_intelligence_config ::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, request_id: request_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_organization_intelligence_config({ intelligence_config: intelligence_config, update_mask: update_mask, 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.update_organization_intelligence_config(::Google::Cloud::Storage::Control::V2::UpdateOrganizationIntelligenceConfigRequest.new(intelligence_config: intelligence_config, update_mask: update_mask, 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, update_organization_intelligence_config_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Cloud::Storage::Control::V2::StorageControl::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::Cloud::Storage::Control::V2::StorageControl::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::Storage::Control::V2::StorageControl::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Cloud::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Storage::Control::V2::StorageControl::Client, client - assert_equal creds, client.configure.credentials - end - 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::Storage::Control::V2::StorageControl::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Storage::Control::V2::StorageControl::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-storage-control-v2/test/helper.rb b/owl-bot-staging/google-cloud-storage-control-v2/test/helper.rb deleted file mode 100644 index f0e715458fa2..000000000000 --- a/owl-bot-staging/google-cloud-storage-control-v2/test/helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "grpc" - -require "ostruct"