From 34dd0e130691c6f883f702c5a06b3527f30087d6 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 13 Jul 2026 11:57:06 +0000 Subject: [PATCH 1/2] feat(secretmanager): add support for Managed Rotation This change introduces new RPCs and types to support the Managed Rotation feature for secrets: - New RPCs: - `EnableManagedRotation`: Enables managed rotation on a secret. - `RotateSecret`: Triggers an immediate rotation for a secret with managed rotation enabled. - New Types: - `SecretType` enum: Allows specifying the type of secret, including `CLOUD_SQL_DB_CREDENTIALS`. - New Fields: - Added `policy_member` to the `Secret` resource, which defines the policy member for the secret. - Added `managed_rotation_status` to the `Rotation` message, to surface the current state and any errors for managed rotation. PiperOrigin-RevId: 946895132 Source-Link: https://github.com/googleapis/googleapis/commit/fc645e542596b58c68b1663bed726eeb7aab7bff Source-Link: https://github.com/googleapis/googleapis-gen/commit/424a88edcfd6475667684f645f6b5979e2bc4622 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXNlY3JldF9tYW5hZ2VyLXYxLy5Pd2xCb3QueWFtbCIsImgiOiI0MjRhODhlZGNmZDY0NzU2Njc2ODRmNjQ1ZjZiNTk3OWUyYmM0NjIyIn0= --- .../google-cloud-secret_manager-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../google-cloud-secret_manager-v1/.toys.rb | 28 + .../google-cloud-secret_manager-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-secret_manager-v1/Gemfile | 14 + .../google-cloud-secret_manager-v1/LICENSE.md | 201 ++ .../google-cloud-secret_manager-v1/README.md | 154 ++ .../google-cloud-secret_manager-v1/Rakefile | 169 ++ .../gapic_metadata.json | 103 + .../google-cloud-secret_manager-v1.gemspec | 30 + .../lib/google-cloud-secret_manager-v1.rb | 21 + .../lib/google/cloud/secret_manager/v1.rb | 45 + .../secret_manager/v1/bindings_override.rb | 75 + .../google/cloud/secret_manager/v1/rest.rb | 38 + .../v1/secret_manager_service.rb | 61 + .../v1/secret_manager_service/client.rb | 2189 +++++++++++++++++ .../v1/secret_manager_service/credentials.rb | 51 + .../v1/secret_manager_service/paths.rb | 167 ++ .../v1/secret_manager_service/rest.rb | 59 + .../v1/secret_manager_service/rest/client.rb | 2035 +++++++++++++++ .../rest/service_stub.rb | 1257 ++++++++++ .../google/cloud/secret_manager/v1/version.rb | 28 + .../cloud/secretmanager/v1/resources_pb.rb | 46 + .../cloud/secretmanager/v1/service_pb.rb | 48 + .../secretmanager/v1/service_services_pb.rb | 128 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 +++++ .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 ++ .../cloud/secretmanager/v1/resources.rb | 596 +++++ .../google/cloud/secretmanager/v1/service.rb | 366 +++ .../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/iam/v1/resource_policy_member.rb | 49 + .../proto_docs/google/protobuf/any.rb | 145 ++ .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++ .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../access_secret_version.rb | 47 + .../add_secret_version.rb | 47 + .../secret_manager_service/create_secret.rb | 47 + .../secret_manager_service/delete_secret.rb | 47 + .../destroy_secret_version.rb | 47 + .../disable_secret_version.rb | 47 + .../enable_managed_rotation.rb | 47 + .../enable_secret_version.rb | 47 + .../secret_manager_service/get_iam_policy.rb | 47 + .../secret_manager_service/get_secret.rb | 47 + .../get_secret_version.rb | 47 + .../list_secret_versions.rb | 51 + .../secret_manager_service/list_secrets.rb | 51 + .../secret_manager_service/rotate_secret.rb | 47 + .../secret_manager_service/set_iam_policy.rb | 47 + .../test_iam_permissions.rb | 47 + .../secret_manager_service/update_secret.rb | 47 + ...etadata_google.cloud.secretmanager.v1.json | 695 ++++++ .../v1/secret_manager_service_paths_test.rb | 109 + .../v1/secret_manager_service_rest_test.rb | 1036 ++++++++ .../v1/secret_manager_service_test.rb | 1139 +++++++++ .../test/helper.rb | 26 + 69 files changed, 14310 insertions(+) create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/README.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/google-cloud-secret_manager-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google-cloud-secret_manager-v1.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/resources.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/service.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/resource_policy_member.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_managed_rotation.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/rotate_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb create mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/.gitignore b/owl-bot-staging/google-cloud-secret_manager-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-secret_manager-v1/.repo-metadata.json new file mode 100644 index 000000000000..828476632af4 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "secretmanager.googleapis.com", + "api_shortname": "secretmanager", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1/latest", + "distribution_name": "google-cloud-secret_manager-v1", + "is_cloud": true, + "language": "ruby", + "name": "secretmanager", + "name_pretty": "Secret Manager V1 API", + "product_documentation": "https://cloud.google.com/secret-manager", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. Note that google-cloud-secret_manager-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secret_manager instead. See the readme for more details.", + "ruby-cloud-env-prefix": "SECRET_MANAGER", + "ruby-cloud-product-url": "https://cloud.google.com/secret-manager", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/.rubocop.yml b/owl-bot-staging/google-cloud-secret_manager-v1/.rubocop.yml new file mode 100644 index 000000000000..2600ed75e42a --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-secret_manager-v1.gemspec" + - "lib/**/*_pb.rb" + - "proto_docs/**/*" + - "test/**/*" + - "acceptance/**/*" + - "samples/acceptance/**/*" + - "Rakefile" + +Layout/LineLength: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" +Naming/FileName: + Exclude: + - "lib/google-cloud-secret_manager-v1.rb" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/.toys.rb b/owl-bot-staging/google-cloud-secret_manager-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/.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-secret_manager-v1/.yardopts b/owl-bot-staging/google-cloud-secret_manager-v1/.yardopts new file mode 100644 index 000000000000..6a5817faa0dc --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Secret Manager V1 API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +./proto_docs/**/*.rb +- +README.md +LICENSE.md +AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-secret_manager-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..6ba9773b1dc0 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-secret_manager-v1 library is to use +[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). +To review all of your authentication options, see [Credentials lookup](#credential-lookup). + +## Quickstart + +The following example shows how to set up authentication for a local development +environment with your user credentials. + +**NOTE:** This method is _not_ recommended for running in production. User credentials +should be used only during development. + +1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). +2. Set up a local ADC file with your user credentials: + +```sh +gcloud auth application-default login +``` + +3. Write code as if already authenticated. + +For more information about setting up authentication for a local development environment, see +[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). + +## Credential Lookup + +The google-cloud-secret_manager-v1 library provides several mechanisms to configure your system. +Generally, using Application Default Credentials to facilitate automatic +credentials discovery is the easist method. But if you need to explicitly specify +credentials, there are several methods available to you. + +Credentials are accepted in the following ways, in the following order or precedence: + +1. Credentials specified in method arguments +2. Credentials specified in configuration +3. Credentials pointed to or included in environment variables +4. Credentials found in local ADC file +5. Credentials returned by the metadata server for the attached service account (GCP) + +### Configuration + +You can configure a path to a JSON credentials file, either for an individual client object or +globally, for all client objects. The JSON file can contain credentials created for +[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), +[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a +[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). + +Note: Service account keys are a security risk if not managed correctly. You should +[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) +whenever possible. + +To configure a credentials file for an individual client initialization: + +```ruby +require "google/cloud/secret_manager/v1" + +client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/secret_manager/v1" + +::Google::Cloud::SecretManager::V1::SecretManagerService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::SecretManager::V1::SecretManagerService::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-secret_manager-v1 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/secret_manager/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::SecretManager::V1::SecretManagerService::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-secret_manager-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-secret_manager-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/Gemfile b/owl-bot-staging/google-cloud-secret_manager-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/LICENSE.md b/owl-bot-staging/google-cloud-secret_manager-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/README.md b/owl-bot-staging/google-cloud-secret_manager-v1/README.md new file mode 100644 index 000000000000..2313a9df45b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Secret Manager V1 API + +Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security. + +Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Secret Manager V1 API. Most users should consider using +the main client gem, +[google-cloud-secret_manager](https://rubygems.org/gems/google-cloud-secret_manager). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-secret_manager-v1 +``` + +## Before You Begin + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/secretmanager.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/secret_manager/v1" + +client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +request = ::Google::Cloud::SecretManager::V1::ListSecretsRequest.new # (request fields as keyword arguments...) +response = client.list_secrets request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/secret-manager) +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/secret_manager/v1" +require "logger" + +client = ::Google::Cloud::SecretManager::V1::SecretManagerService::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.2+. + +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-secret_manager`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-secret_manager-v1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-secret_manager`. +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-secret_manager-v1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/Rakefile b/owl-bot-staging/google-cloud-secret_manager-v1/Rakefile new file mode 100644 index 000000000000..47dd5c67678f --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["SECRET_MANAGER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["SECRET_MANAGER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["SECRET_MANAGER_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 SECRET_MANAGER_TEST_PROJECT=test123 SECRET_MANAGER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/secret_manager/v1/secret_manager_service/credentials" + ::Google::Cloud::SecretManager::V1::SecretManagerService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["SECRET_MANAGER_PROJECT"] = project + ENV["SECRET_MANAGER_TEST_PROJECT"] = project + ENV["SECRET_MANAGER_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-secret_manager-v1 gem has no acceptance tests." + end + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-secret_manager-v1 gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-secret_manager-v1 gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-secret_manager-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-secret_manager-v1" + header "google-cloud-secret_manager-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-secret_manager-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-secret_manager-v1 test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-secret_manager-v1 smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-secret_manager-v1 acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-secret_manager-v1/gapic_metadata.json new file mode 100644 index 000000000000..3964d548b435 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/gapic_metadata.json @@ -0,0 +1,103 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.secretmanager.v1", + "libraryPackage": "::Google::Cloud::SecretManager::V1", + "services": { + "SecretManagerService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client", + "rpcs": { + "ListSecrets": { + "methods": [ + "list_secrets" + ] + }, + "CreateSecret": { + "methods": [ + "create_secret" + ] + }, + "AddSecretVersion": { + "methods": [ + "add_secret_version" + ] + }, + "GetSecret": { + "methods": [ + "get_secret" + ] + }, + "UpdateSecret": { + "methods": [ + "update_secret" + ] + }, + "DeleteSecret": { + "methods": [ + "delete_secret" + ] + }, + "ListSecretVersions": { + "methods": [ + "list_secret_versions" + ] + }, + "GetSecretVersion": { + "methods": [ + "get_secret_version" + ] + }, + "AccessSecretVersion": { + "methods": [ + "access_secret_version" + ] + }, + "DisableSecretVersion": { + "methods": [ + "disable_secret_version" + ] + }, + "EnableSecretVersion": { + "methods": [ + "enable_secret_version" + ] + }, + "DestroySecretVersion": { + "methods": [ + "destroy_secret_version" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + }, + "EnableManagedRotation": { + "methods": [ + "enable_managed_rotation" + ] + }, + "RotateSecret": { + "methods": [ + "rotate_secret" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/google-cloud-secret_manager-v1.gemspec b/owl-bot-staging/google-cloud-secret_manager-v1/google-cloud-secret_manager-v1.gemspec new file mode 100644 index 000000000000..18cfe2f732c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/google-cloud-secret_manager-v1.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/secret_manager/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-secret_manager-v1" + gem.version = Google::Cloud::SecretManager::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. Note that google-cloud-secret_manager-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secret_manager instead. See the readme for more details." + gem.summary = "Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security." + 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.2" + + gem.add_dependency "gapic-common", "~> 1.3" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google-cloud-secret_manager-v1.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google-cloud-secret_manager-v1.rb new file mode 100644 index 000000000000..7a966609a639 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google-cloud-secret_manager-v1.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/secret_manager/v1" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1.rb new file mode 100644 index 000000000000..7ea91d418dcd --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1.rb @@ -0,0 +1,45 @@ +# 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/secret_manager/v1/secret_manager_service" +require "google/cloud/secret_manager/v1/version" + +module Google + module Cloud + module SecretManager + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/secret_manager/v1" + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/secret_manager/v1" + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/secret_manager/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/bindings_override.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/bindings_override.rb new file mode 100644 index 000000000000..fc80b7225c1e --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/bindings_override.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! + +require "gapic/rest" + +module Google + module Cloud + module SecretManager + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/secret_manager/v1/rest" + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "SecretManager"] + 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config + default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/rest.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/rest.rb new file mode 100644 index 000000000000..4131c19cc0dc --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/rest.rb @@ -0,0 +1,38 @@ +# 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/secret_manager/v1/secret_manager_service/rest" +require "google/cloud/secret_manager/v1/bindings_override" +require "google/cloud/secret_manager/v1/version" + +module Google + module Cloud + module SecretManager + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/secret_manager/v1/rest" + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service.rb new file mode 100644 index 000000000000..951657359f0c --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service.rb @@ -0,0 +1,61 @@ +# 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/secret_manager/v1/version" + +require "google/cloud/secret_manager/v1/secret_manager_service/credentials" +require "google/cloud/secret_manager/v1/secret_manager_service/paths" +require "google/cloud/secret_manager/v1/secret_manager_service/client" +require "google/cloud/secret_manager/v1/secret_manager_service/rest" + +module Google + module Cloud + module SecretManager + module V1 + ## + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::SecretManager::V1::Secret Secret} + # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/secret_manager/v1/secret_manager_service" + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/secret_manager/v1/secret_manager_service/rest" + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + module SecretManagerService + end + end + end + end +end + +helper_path = ::File.join __dir__, "secret_manager_service", "helpers.rb" +require "google/cloud/secret_manager/v1/secret_manager_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb new file mode 100644 index 000000000000..8d3d673b37d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb @@ -0,0 +1,2189 @@ +# 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/cloud/secretmanager/v1/service_pb" +require "google/cloud/location" + +module Google + module Cloud + module SecretManager + module V1 + module SecretManagerService + ## + # Client for the SecretManagerService service. + # + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::SecretManager::V1::Secret Secret} + # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :secret_manager_service_stub + + ## + # Configure the SecretManagerService Client class. + # + # See {::Google::Cloud::SecretManager::V1::SecretManagerService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecretManagerService clients + # ::Google::Cloud::SecretManager::V1::SecretManagerService::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", "SecretManager", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_secrets.timeout = 60.0 + + default_config.rpcs.create_secret.timeout = 60.0 + + default_config.rpcs.add_secret_version.timeout = 60.0 + + default_config.rpcs.get_secret.timeout = 60.0 + + default_config.rpcs.update_secret.timeout = 60.0 + + default_config.rpcs.delete_secret.timeout = 60.0 + + default_config.rpcs.list_secret_versions.timeout = 60.0 + + default_config.rpcs.get_secret_version.timeout = 60.0 + + default_config.rpcs.access_secret_version.timeout = 60.0 + default_config.rpcs.access_secret_version.retry_policy = { + initial_delay: 2.0, max_delay: 60.0, multiplier: 2.0, retry_codes: [14, 8] + } + + default_config.rpcs.disable_secret_version.timeout = 60.0 + + default_config.rpcs.enable_secret_version.timeout = 60.0 + + default_config.rpcs.destroy_secret_version.timeout = 60.0 + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + + default_config.rpcs.test_iam_permissions.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SecretManagerService 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::SecretManager::V1::SecretManagerService::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 + @secret_manager_service_stub.universe_domain + end + + ## + # Create a new SecretManagerService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecretManagerService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/secretmanager/v1/service_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 + + @secret_manager_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::SecretManager::V1::SecretManagerService::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 + ) + + @secret_manager_service_stub.stub_logger&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @secret_manager_service_stub.endpoint + config.universe_domain = @secret_manager_service_stub.universe_domain + config.logger = @secret_manager_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @secret_manager_service_stub.logger + end + + # Service calls + + ## + # Lists {::Google::Cloud::SecretManager::V1::Secret Secrets}. + # + # @overload list_secrets(request, options = nil) + # Pass arguments to `list_secrets` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::ListSecretsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::ListSecretsRequest, ::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_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_secrets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project associated with the + # {::Google::Cloud::SecretManager::V1::Secret Secrets}, in the format `projects/*` + # or `projects/*/locations/*` + # @param page_size [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::SecretManager::V1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. + # @param filter [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secrets matching the filter. If filter is empty, all secrets are + # listed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::ListSecretsRequest.new + # + # # Call the list_secrets method. + # result = client.list_secrets 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::SecretManager::V1::Secret. + # p item + # end + # + def list_secrets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretsRequest + + # 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_secrets.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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_secrets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_secrets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :list_secrets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, 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 a new {::Google::Cloud::SecretManager::V1::Secret Secret} containing no + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. + # + # @overload create_secret(request, options = nil) + # Pass arguments to `create_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::CreateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::CreateSecretRequest, ::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_secret(parent: nil, secret_id: nil, secret: nil) + # Pass arguments to `create_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project to associate with the + # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format `projects/*` + # or `projects/*/locations/*`. + # @param secret_id [::String] + # Required. This must be unique within the project. + # + # A secret ID is a string with a maximum length of 255 characters and can + # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + # underscore (`_`) characters. + # @param secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash] + # Required. A {::Google::Cloud::SecretManager::V1::Secret Secret} with initial + # field values. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::Secret] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::CreateSecretRequest.new + # + # # Call the create_secret method. + # result = client.create_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + # p result + # + def create_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::CreateSecretRequest + + # 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_secret.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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :create_secret, 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 {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} + # containing secret data and attaches it to an existing + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload add_secret_version(request, options = nil) + # Pass arguments to `add_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::AddSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest, ::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 add_secret_version(parent: nil, payload: nil) + # Pass arguments to `add_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @param payload [::Google::Cloud::SecretManager::V1::SecretPayload, ::Hash] + # Required. The secret payload of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new + # + # # Call the add_secret_version method. + # result = client.add_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def add_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest + + # 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.add_secret_version.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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :add_secret_version, 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 metadata for a given {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload get_secret(request, options = nil) + # Pass arguments to `get_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::GetSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::GetSecretRequest, ::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_secret(name: nil) + # Pass arguments to `get_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::Secret] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::GetSecretRequest.new + # + # # Call the get_secret method. + # result = client.get_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + # p result + # + def get_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretRequest + + # 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_secret.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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :get_secret, 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 metadata of an existing + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload update_secret(request, options = nil) + # Pass arguments to `update_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::UpdateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::UpdateSecretRequest, ::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_secret(secret: nil, update_mask: nil) + # Pass arguments to `update_secret` 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 secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash] + # Required. {::Google::Cloud::SecretManager::V1::Secret Secret} with updated field + # values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Specifies the fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::Secret] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::UpdateSecretRequest.new + # + # # Call the update_secret method. + # result = client.update_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + # p result + # + def update_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::UpdateSecretRequest + + # 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_secret.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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.secret&.name + header_params["secret.name"] = request.secret.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_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :update_secret, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload delete_secret(request, options = nil) + # Pass arguments to `delete_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::DeleteSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::DeleteSecretRequest, ::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_secret(name: nil, etag: nil) + # Pass arguments to `delete_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to delete in the format + # `projects/*/secrets/*`. + # @param etag [::String] + # Optional. Etag of the {::Google::Cloud::SecretManager::V1::Secret Secret}. The + # request succeeds if it matches the etag of the currently stored secret + # object. If the etag is omitted, the request succeeds. + # + # @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/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::DeleteSecretRequest.new + # + # # Call the delete_secret method. + # result = client.delete_secret request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DeleteSecretRequest + + # 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_secret.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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :delete_secret, 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 {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. This + # call does not return secret data. + # + # @overload list_secret_versions(request, options = nil) + # Pass arguments to `list_secret_versions` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest, ::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_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_secret_versions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} associated with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} to list, in + # the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @param page_size [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # ListSecretVersionsResponse.next_page_token][]. + # @param filter [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secret versions matching the filter. If filter is empty, all secret + # versions are listed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new + # + # # Call the list_secret_versions method. + # result = client.list_secret_versions 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::SecretManager::V1::SecretVersion. + # p item + # end + # + def list_secret_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest + + # 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_secret_versions.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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_secret_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :list_secret_versions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, 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 + + ## + # Gets metadata for a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # `projects/*/secrets/*/versions/latest` is an alias to the most recently + # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # @overload get_secret_version(request, options = nil) + # Pass arguments to `get_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::GetSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest, ::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_secret_version(name: nil) + # Pass arguments to `get_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new + # + # # Call the get_secret_version method. + # result = client.get_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def get_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest + + # 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_secret_version.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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :get_secret_version, 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 + + ## + # Accesses a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # This call returns the secret data. + # + # `projects/*/secrets/*/versions/latest` is an alias to the most recently + # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # @overload access_secret_version(request, options = nil) + # Pass arguments to `access_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest, ::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 access_secret_version(name: nil) + # Pass arguments to `access_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new + # + # # Call the access_secret_version method. + # result = client.access_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::AccessSecretVersionResponse. + # p result + # + def access_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest + + # 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.access_secret_version.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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.access_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :access_secret_version, 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 + + ## + # Disables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DISABLED DISABLED}. + # + # @overload disable_secret_version(request, options = nil) + # Pass arguments to `disable_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest, ::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_secret_version(name: nil, etag: nil) + # Pass arguments to `disable_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to disable in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new + # + # # Call the disable_secret_version method. + # result = client.disable_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def disable_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest + + # 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_secret_version.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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.disable_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :disable_secret_version, 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 + + ## + # Enables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1::SecretVersion::State::ENABLED ENABLED}. + # + # @overload enable_secret_version(request, options = nil) + # Pass arguments to `enable_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest, ::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 enable_secret_version(name: nil, etag: nil) + # Pass arguments to `enable_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to enable in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new + # + # # Call the enable_secret_version method. + # result = client.enable_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def enable_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest + + # 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.enable_secret_version.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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.enable_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :enable_secret_version, 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 + + ## + # Destroys a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DESTROYED DESTROYED} + # and irrevocably destroys the secret data. + # + # @overload destroy_secret_version(request, options = nil) + # Pass arguments to `destroy_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest, ::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 destroy_secret_version(name: nil, etag: nil) + # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to destroy in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new + # + # # Call the destroy_secret_version method. + # result = client.destroy_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def destroy_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest + + # 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.destroy_secret_version.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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.destroy_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :destroy_secret_version, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on the specified secret. Replaces any + # existing policy. + # + # Permissions on + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} are enforced + # according to the policy set on the associated + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @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/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a secret. + # Returns empty policy if the secret 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/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has for the specified secret. + # If the secret does not exist, this call returns 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/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Enables the managed rotation feature for a + # {::Google::Cloud::SecretManager::V1::Secret Secret}. This method can only be + # triggered once for a secret. In order to do further rotations, RotateSecret + # should be used. This method will add a secret version and update the + # password in Cloud SQL. + # + # @overload enable_managed_rotation(request, options = nil) + # Pass arguments to `enable_managed_rotation` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest, ::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 enable_managed_rotation(parent: nil, cloud_sql_single_user_credentials: nil) + # Pass arguments to `enable_managed_rotation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @param cloud_sql_single_user_credentials [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest::CloudSQLSingleUserCredentials, ::Hash] + # Credentials required for Cloud SQL DB for Single user Managed Rotation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new + # + # # Call the enable_managed_rotation method. + # result = client.enable_managed_rotation request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def enable_managed_rotation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest + + # 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.enable_managed_rotation.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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.enable_managed_rotation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.enable_managed_rotation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :enable_managed_rotation, 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 + + ## + # Do a managed rotation for a {::Google::Cloud::SecretManager::V1::Secret Secret}. + # This can only be triggered after Managed rotation has been enabled. + # This method will add a secret version and update the password in Cloud SQL. + # + # @overload rotate_secret(request, options = nil) + # Pass arguments to `rotate_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::RotateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::RotateSecretRequest, ::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 rotate_secret(parent: nil) + # Pass arguments to `rotate_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::RotateSecretRequest.new + # + # # Call the rotate_secret method. + # result = client.rotate_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def rotate_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::RotateSecretRequest + + # 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.rotate_secret.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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.rotate_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.rotate_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :rotate_secret, 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 SecretManagerService API. + # + # This class represents the configuration for SecretManagerService, + # 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::SecretManager::V1::SecretManagerService::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_secrets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_secrets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_secrets.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::SecretManager::V1::SecretManagerService::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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "secretmanager.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 SecretManagerService 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_secrets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_secrets + ## + # RPC-specific configuration for `create_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :create_secret + ## + # RPC-specific configuration for `add_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :add_secret_version + ## + # RPC-specific configuration for `get_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :get_secret + ## + # RPC-specific configuration for `update_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :update_secret + ## + # RPC-specific configuration for `delete_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_secret + ## + # RPC-specific configuration for `list_secret_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_secret_versions + ## + # RPC-specific configuration for `get_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_secret_version + ## + # RPC-specific configuration for `access_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :access_secret_version + ## + # RPC-specific configuration for `disable_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_secret_version + ## + # RPC-specific configuration for `enable_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_secret_version + ## + # RPC-specific configuration for `destroy_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :destroy_secret_version + ## + # 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 + ## + # RPC-specific configuration for `enable_managed_rotation` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_managed_rotation + ## + # RPC-specific configuration for `rotate_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :rotate_secret + + # @private + def initialize parent_rpcs = nil + list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets + @list_secrets = ::Gapic::Config::Method.new list_secrets_config + create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret + @create_secret = ::Gapic::Config::Method.new create_secret_config + add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version + @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config + get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret + @get_secret = ::Gapic::Config::Method.new get_secret_config + update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret + @update_secret = ::Gapic::Config::Method.new update_secret_config + delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret + @delete_secret = ::Gapic::Config::Method.new delete_secret_config + list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions + @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config + get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version + @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config + access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version + @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config + disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version + @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config + enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version + @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config + destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version + @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_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 + 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 + enable_managed_rotation_config = parent_rpcs.enable_managed_rotation if parent_rpcs.respond_to? :enable_managed_rotation + @enable_managed_rotation = ::Gapic::Config::Method.new enable_managed_rotation_config + rotate_secret_config = parent_rpcs.rotate_secret if parent_rpcs.respond_to? :rotate_secret + @rotate_secret = ::Gapic::Config::Method.new rotate_secret_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.rb new file mode 100644 index 000000000000..b47fca61abf1 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.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! + +require "googleauth" + +module Google + module Cloud + module SecretManager + module V1 + module SecretManagerService + # Credentials for the SecretManagerService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "SECRET_MANAGER_CREDENTIALS", + "SECRET_MANAGER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "SECRET_MANAGER_CREDENTIALS_JSON", + "SECRET_MANAGER_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb new file mode 100644 index 000000000000..426a2a6ef38b --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb @@ -0,0 +1,167 @@ +# 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 SecretManager + module V1 + module SecretManagerService + # Path helper methods for the SecretManagerService API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Project resource string. + # + # The resource will be in the following format: + # + # `projects/{project}` + # + # @param project [String] + # + # @return [::String] + def project_path project: + "projects/#{project}" + end + + ## + # Create a fully-qualified Secret resource string. + # + # @overload secret_path(project:, secret:) + # The resource will be in the following format: + # + # `projects/{project}/secrets/{secret}` + # + # @param project [String] + # @param secret [String] + # + # @overload secret_path(project:, location:, secret:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/secrets/{secret}` + # + # @param project [String] + # @param location [String] + # @param secret [String] + # + # @return [::String] + def secret_path **args + resources = { + "project:secret" => (proc do |project:, secret:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/secrets/#{secret}" + end), + "location:project:secret" => (proc do |project:, location:, secret:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/secrets/#{secret}" + 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 SecretVersion resource string. + # + # @overload secret_version_path(project:, secret:, secret_version:) + # The resource will be in the following format: + # + # `projects/{project}/secrets/{secret}/versions/{secret_version}` + # + # @param project [String] + # @param secret [String] + # @param secret_version [String] + # + # @overload secret_version_path(project:, location:, secret:, secret_version:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}` + # + # @param project [String] + # @param location [String] + # @param secret [String] + # @param secret_version [String] + # + # @return [::String] + def secret_version_path **args + resources = { + "project:secret:secret_version" => (proc do |project:, secret:, secret_version:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" + + "projects/#{project}/secrets/#{secret}/versions/#{secret_version}" + end), + "location:project:secret:secret_version" => (proc do |project:, location:, secret:, secret_version:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" + + "projects/#{project}/locations/#{location}/secrets/#{secret}/versions/#{secret_version}" + 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 Topic resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/topics/{topic}` + # + # @param project [String] + # @param topic [String] + # + # @return [::String] + def topic_path project:, topic: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/topics/#{topic}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb new file mode 100644 index 000000000000..75d9fc9de126 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb @@ -0,0 +1,59 @@ +# 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/secret_manager/v1/version" +require "google/cloud/secret_manager/v1/bindings_override" + +require "google/cloud/secret_manager/v1/secret_manager_service/credentials" +require "google/cloud/secret_manager/v1/secret_manager_service/paths" +require "google/cloud/secret_manager/v1/secret_manager_service/rest/client" + +module Google + module Cloud + module SecretManager + module V1 + ## + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::SecretManager::V1::Secret Secret} + # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/secret_manager/v1/secret_manager_service/rest" + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + module SecretManagerService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/secret_manager/v1/secret_manager_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb new file mode 100644 index 000000000000..30a809f07a9c --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb @@ -0,0 +1,2035 @@ +# 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/cloud/secretmanager/v1/service_pb" +require "google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module SecretManager + module V1 + module SecretManagerService + module Rest + ## + # REST client for the SecretManagerService service. + # + # Secret Manager Service + # + # Manages secrets and operations using those secrets. Implements a REST + # model with the following objects: + # + # * {::Google::Cloud::SecretManager::V1::Secret Secret} + # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :secret_manager_service_stub + + ## + # Configure the SecretManagerService Client class. + # + # See {::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all SecretManagerService clients + # ::Google::Cloud::SecretManager::V1::SecretManagerService::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", "SecretManager", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.list_secrets.timeout = 60.0 + + default_config.rpcs.create_secret.timeout = 60.0 + + default_config.rpcs.add_secret_version.timeout = 60.0 + + default_config.rpcs.get_secret.timeout = 60.0 + + default_config.rpcs.update_secret.timeout = 60.0 + + default_config.rpcs.delete_secret.timeout = 60.0 + + default_config.rpcs.list_secret_versions.timeout = 60.0 + + default_config.rpcs.get_secret_version.timeout = 60.0 + + default_config.rpcs.access_secret_version.timeout = 60.0 + default_config.rpcs.access_secret_version.retry_policy = { + initial_delay: 2.0, max_delay: 60.0, multiplier: 2.0, retry_codes: [14, 8] + } + + default_config.rpcs.disable_secret_version.timeout = 60.0 + + default_config.rpcs.enable_secret_version.timeout = 60.0 + + default_config.rpcs.destroy_secret_version.timeout = 60.0 + + default_config.rpcs.set_iam_policy.timeout = 60.0 + + default_config.rpcs.get_iam_policy.timeout = 60.0 + + default_config.rpcs.test_iam_permissions.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the SecretManagerService 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::SecretManager::V1::SecretManagerService::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 + @secret_manager_service_stub.universe_domain + end + + ## + # Create a new SecretManagerService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the SecretManagerService 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 + + @secret_manager_service_stub = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @secret_manager_service_stub.logger(stub: true)&.info do |entry| + entry.set_system_name + entry.set_service + entry.message = "Created client for #{entry.service}" + entry.set_credentials_fields credentials + entry.set "customEndpoint", @config.endpoint if @config.endpoint + entry.set "defaultTimeout", @config.timeout if @config.timeout + entry.set "quotaProject", @quota_project_id if @quota_project_id + end + + @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @secret_manager_service_stub.endpoint + config.universe_domain = @secret_manager_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @secret_manager_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @secret_manager_service_stub.logger + end + + # Service calls + + ## + # Lists {::Google::Cloud::SecretManager::V1::Secret Secrets}. + # + # @overload list_secrets(request, options = nil) + # Pass arguments to `list_secrets` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::ListSecretsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::ListSecretsRequest, ::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_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_secrets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project associated with the + # {::Google::Cloud::SecretManager::V1::Secret Secrets}, in the format `projects/*` + # or `projects/*/locations/*` + # @param page_size [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::SecretManager::V1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. + # @param filter [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secrets matching the filter. If filter is empty, all secrets are + # listed. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::ListSecretsRequest.new + # + # # Call the list_secrets method. + # result = client.list_secrets 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::SecretManager::V1::Secret. + # p item + # end + # + def list_secrets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_secrets.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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_secrets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_secrets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.list_secrets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, "secrets", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new {::Google::Cloud::SecretManager::V1::Secret Secret} containing no + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. + # + # @overload create_secret(request, options = nil) + # Pass arguments to `create_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::CreateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::CreateSecretRequest, ::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_secret(parent: nil, secret_id: nil, secret: nil) + # Pass arguments to `create_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the project to associate with the + # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format `projects/*` + # or `projects/*/locations/*`. + # @param secret_id [::String] + # Required. This must be unique within the project. + # + # A secret ID is a string with a maximum length of 255 characters and can + # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + # underscore (`_`) characters. + # @param secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash] + # Required. A {::Google::Cloud::SecretManager::V1::Secret Secret} with initial + # field values. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::CreateSecretRequest.new + # + # # Call the create_secret method. + # result = client.create_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + # p result + # + def create_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::CreateSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.create_secret.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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.create_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.create_secret request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} + # containing secret data and attaches it to an existing + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload add_secret_version(request, options = nil) + # Pass arguments to `add_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::AddSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest, ::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 add_secret_version(parent: nil, payload: nil) + # Pass arguments to `add_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @param payload [::Google::Cloud::SecretManager::V1::SecretPayload, ::Hash] + # Required. The secret payload of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new + # + # # Call the add_secret_version method. + # result = client.add_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def add_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest + + # 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.add_secret_version.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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.add_secret_version 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 metadata for a given {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload get_secret(request, options = nil) + # Pass arguments to `get_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::GetSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::GetSecretRequest, ::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_secret(name: nil) + # Pass arguments to `get_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::GetSecretRequest.new + # + # # Call the get_secret method. + # result = client.get_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + # p result + # + def get_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretRequest + + # 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_secret.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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.get_secret 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 metadata of an existing + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload update_secret(request, options = nil) + # Pass arguments to `update_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::UpdateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::UpdateSecretRequest, ::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_secret(secret: nil, update_mask: nil) + # Pass arguments to `update_secret` 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 secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash] + # Required. {::Google::Cloud::SecretManager::V1::Secret Secret} with updated field + # values. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Specifies the fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::UpdateSecretRequest.new + # + # # Call the update_secret method. + # result = client.update_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + # p result + # + def update_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::UpdateSecretRequest + + # 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_secret.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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.update_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.update_secret request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload delete_secret(request, options = nil) + # Pass arguments to `delete_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::DeleteSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::DeleteSecretRequest, ::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_secret(name: nil, etag: nil) + # Pass arguments to `delete_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to delete in the format + # `projects/*/secrets/*`. + # @param etag [::String] + # Optional. Etag of the {::Google::Cloud::SecretManager::V1::Secret Secret}. The + # request succeeds if it matches the etag of the currently stored secret + # object. If the etag is omitted, the request succeeds. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::DeleteSecretRequest.new + # + # # Call the delete_secret method. + # result = client.delete_secret request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DeleteSecretRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_secret.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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.delete_secret request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. This + # call does not return secret data. + # + # @overload list_secret_versions(request, options = nil) + # Pass arguments to `list_secret_versions` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest, ::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_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_secret_versions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} associated with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} to list, in + # the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @param page_size [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @param page_token [::String] + # Optional. Pagination token, returned earlier via + # ListSecretVersionsResponse.next_page_token][]. + # @param filter [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secret versions matching the filter. If filter is empty, all secret + # versions are listed. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new + # + # # Call the list_secret_versions method. + # result = client.list_secret_versions 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::SecretManager::V1::SecretVersion. + # p item + # end + # + def list_secret_versions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_secret_versions.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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_secret_versions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.list_secret_versions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, "versions", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets metadata for a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # `projects/*/secrets/*/versions/latest` is an alias to the most recently + # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # @overload get_secret_version(request, options = nil) + # Pass arguments to `get_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::GetSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest, ::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_secret_version(name: nil) + # Pass arguments to `get_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new + # + # # Call the get_secret_version method. + # result = client.get_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def get_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest + + # 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_secret_version.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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.get_secret_version 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 + + ## + # Accesses a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # This call returns the secret data. + # + # `projects/*/secrets/*/versions/latest` is an alias to the most recently + # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # @overload access_secret_version(request, options = nil) + # Pass arguments to `access_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest, ::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 access_secret_version(name: nil) + # Pass arguments to `access_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new + # + # # Call the access_secret_version method. + # result = client.access_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::AccessSecretVersionResponse. + # p result + # + def access_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest + + # 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.access_secret_version.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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.access_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.access_secret_version 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 + + ## + # Disables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DISABLED DISABLED}. + # + # @overload disable_secret_version(request, options = nil) + # Pass arguments to `disable_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest, ::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_secret_version(name: nil, etag: nil) + # Pass arguments to `disable_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to disable in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new + # + # # Call the disable_secret_version method. + # result = client.disable_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def disable_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest + + # 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.disable_secret_version.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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.disable_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.disable_secret_version 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 + + ## + # Enables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1::SecretVersion::State::ENABLED ENABLED}. + # + # @overload enable_secret_version(request, options = nil) + # Pass arguments to `enable_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest, ::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 enable_secret_version(name: nil, etag: nil) + # Pass arguments to `enable_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to enable in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new + # + # # Call the enable_secret_version method. + # result = client.enable_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def enable_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest + + # 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.enable_secret_version.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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.enable_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.enable_secret_version 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 + + ## + # Destroys a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # + # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to + # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DESTROYED DESTROYED} + # and irrevocably destroys the secret data. + # + # @overload destroy_secret_version(request, options = nil) + # Pass arguments to `destroy_secret_version` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest, ::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 destroy_secret_version(name: nil, etag: nil) + # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to destroy in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @param etag [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new + # + # # Call the destroy_secret_version method. + # result = client.destroy_secret_version request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def destroy_secret_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest + + # 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.destroy_secret_version.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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.destroy_secret_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.destroy_secret_version request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the access control policy on the specified secret. Replaces any + # existing policy. + # + # Permissions on + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} are enforced + # according to the policy set on the associated + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.set_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a secret. + # Returns empty policy if the secret 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/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.get_iam_policy request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has for the specified secret. + # If the secret does not exist, this call returns 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/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.test_iam_permissions request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Enables the managed rotation feature for a + # {::Google::Cloud::SecretManager::V1::Secret Secret}. This method can only be + # triggered once for a secret. In order to do further rotations, RotateSecret + # should be used. This method will add a secret version and update the + # password in Cloud SQL. + # + # @overload enable_managed_rotation(request, options = nil) + # Pass arguments to `enable_managed_rotation` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest, ::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 enable_managed_rotation(parent: nil, cloud_sql_single_user_credentials: nil) + # Pass arguments to `enable_managed_rotation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @param cloud_sql_single_user_credentials [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest::CloudSQLSingleUserCredentials, ::Hash] + # Credentials required for Cloud SQL DB for Single user Managed Rotation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new + # + # # Call the enable_managed_rotation method. + # result = client.enable_managed_rotation request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def enable_managed_rotation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest + + # 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.enable_managed_rotation.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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.enable_managed_rotation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.enable_managed_rotation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.enable_managed_rotation 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 + + ## + # Do a managed rotation for a {::Google::Cloud::SecretManager::V1::Secret Secret}. + # This can only be triggered after Managed rotation has been enabled. + # This method will add a secret version and update the password in Cloud SQL. + # + # @overload rotate_secret(request, options = nil) + # Pass arguments to `rotate_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::RotateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::RotateSecretRequest, ::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 rotate_secret(parent: nil) + # Pass arguments to `rotate_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::RotateSecretRequest.new + # + # # Call the rotate_secret method. + # result = client.rotate_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def rotate_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::RotateSecretRequest + + # 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.rotate_secret.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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.rotate_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.rotate_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.rotate_secret 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 SecretManagerService REST API. + # + # This class represents the configuration for SecretManagerService 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::SecretManager::V1::SecretManagerService::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_secrets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_secrets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_secrets.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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `: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 = "secretmanager.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 + + # @private + # Overrides for http bindings for the RPCs of this service + # are only used when this service is used as mixin, and only + # by the host service. + # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] + config_attr :bindings_override, {}, ::Hash, nil + 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 SecretManagerService 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. + # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_secrets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_secrets + ## + # RPC-specific configuration for `create_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :create_secret + ## + # RPC-specific configuration for `add_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :add_secret_version + ## + # RPC-specific configuration for `get_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :get_secret + ## + # RPC-specific configuration for `update_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :update_secret + ## + # RPC-specific configuration for `delete_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_secret + ## + # RPC-specific configuration for `list_secret_versions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_secret_versions + ## + # RPC-specific configuration for `get_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :get_secret_version + ## + # RPC-specific configuration for `access_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :access_secret_version + ## + # RPC-specific configuration for `disable_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :disable_secret_version + ## + # RPC-specific configuration for `enable_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_secret_version + ## + # RPC-specific configuration for `destroy_secret_version` + # @return [::Gapic::Config::Method] + # + attr_reader :destroy_secret_version + ## + # 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 + ## + # RPC-specific configuration for `enable_managed_rotation` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_managed_rotation + ## + # RPC-specific configuration for `rotate_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :rotate_secret + + # @private + def initialize parent_rpcs = nil + list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets + @list_secrets = ::Gapic::Config::Method.new list_secrets_config + create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret + @create_secret = ::Gapic::Config::Method.new create_secret_config + add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version + @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config + get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret + @get_secret = ::Gapic::Config::Method.new get_secret_config + update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret + @update_secret = ::Gapic::Config::Method.new update_secret_config + delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret + @delete_secret = ::Gapic::Config::Method.new delete_secret_config + list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions + @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config + get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version + @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config + access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version + @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config + disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version + @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config + enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version + @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config + destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version + @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_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 + 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 + enable_managed_rotation_config = parent_rpcs.enable_managed_rotation if parent_rpcs.respond_to? :enable_managed_rotation + @enable_managed_rotation = ::Gapic::Config::Method.new enable_managed_rotation_config + rotate_secret_config = parent_rpcs.rotate_secret if parent_rpcs.respond_to? :rotate_secret + @rotate_secret = ::Gapic::Config::Method.new rotate_secret_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb new file mode 100644 index 000000000000..6e6dca662ea6 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb @@ -0,0 +1,1257 @@ +# 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/secretmanager/v1/service_pb" + +module Google + module Cloud + module SecretManager + module V1 + module SecretManagerService + module Rest + ## + # REST service stub for the SecretManagerService 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 list_secrets REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::ListSecretsRequest] + # 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::SecretManager::V1::ListSecretsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::ListSecretsResponse] + # A result object deserialized from the server's reply + def list_secrets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_secrets_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_secrets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::ListSecretsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the create_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::CreateSecretRequest] + # 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::SecretManager::V1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # A result object deserialized from the server's reply + def create_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_secret_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "create_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::Secret.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the add_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest] + # 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::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # A result object deserialized from the server's reply + def add_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_secret_version_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: "add_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::SecretVersion.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_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::GetSecretRequest] + # 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::SecretManager::V1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # A result object deserialized from the server's reply + def get_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_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_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::Secret.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_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::UpdateSecretRequest] + # 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::SecretManager::V1::Secret] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::Secret] + # A result object deserialized from the server's reply + def update_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_secret_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_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::Secret.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the delete_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::DeleteSecretRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_secret_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the list_secret_versions REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest] + # 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::SecretManager::V1::ListSecretVersionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse] + # A result object deserialized from the server's reply + def list_secret_versions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_secret_versions_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_secret_versions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse.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_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest] + # 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::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # A result object deserialized from the server's reply + def get_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_version_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_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the access_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest] + # 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::SecretManager::V1::AccessSecretVersionResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] + # A result object deserialized from the server's reply + def access_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_access_secret_version_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: "access_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the disable_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest] + # 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::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # A result object deserialized from the server's reply + def disable_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_disable_secret_version_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: "disable_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the enable_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest] + # 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::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # A result object deserialized from the server's reply + def enable_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_enable_secret_version_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: "enable_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the destroy_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest] + # 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::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # A result object deserialized from the server's reply + def destroy_secret_version request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_destroy_secret_version_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: "destroy_secret_version", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the 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 + + ## + # Baseline implementation for the enable_managed_rotation REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest] + # 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::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # A result object deserialized from the server's reply + def enable_managed_rotation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_enable_managed_rotation_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: "enable_managed_rotation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the rotate_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::RotateSecretRequest] + # 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::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # A result object deserialized from the server's reply + def rotate_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_rotate_secret_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: "rotate_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::SecretVersion.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 list_secrets REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::ListSecretsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_secrets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/secrets", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/secrets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::CreateSecretRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_create_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/secrets", + body: "secret", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/secrets", + body: "secret", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:addVersion", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:addVersion", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::GetSecretRequest] + # 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_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::UpdateSecretRequest] + # 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_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{secret.name}", + body: "secret", + matches: [ + ["secret.name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{secret.name}", + body: "secret", + matches: [ + ["secret.name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::DeleteSecretRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_secret_versions REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_secret_versions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/versions", + matches: [ + ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/versions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest] + # 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_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the access_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_access_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:access", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:access", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the disable_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_disable_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:disable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:disable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the enable_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_enable_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:enable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:enable", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the destroy_secret_version REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_destroy_secret_version_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:destroy", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:destroy", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the enable_managed_rotation REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_enable_managed_rotation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:enableManagedRotation", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:enableManagedRotation", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the rotate_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::RotateSecretRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_rotate_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:rotateSecret", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:rotateSecret", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/version.rb new file mode 100644 index 000000000000..3ac096ce123c --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/version.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! + + +module Google + module Cloud + module SecretManager + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb new file mode 100644 index 000000000000..c7770a98e7bb --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/secretmanager/v1/resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/iam/v1/resource_policy_member_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n-google/cloud/secretmanager/v1/resources.proto\x12\x1dgoogle.cloud.secretmanager.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/iam/v1/resource_policy_member.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xf9\x0b\n\x06Secret\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12G\n\x0breplication\x18\x02 \x01(\x0b\x32*.google.cloud.secretmanager.v1.ReplicationB\x06\xe0\x41\x05\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x06labels\x18\x04 \x03(\x0b\x32\x31.google.cloud.secretmanager.v1.Secret.LabelsEntry\x12\x39\n\x06topics\x18\x05 \x03(\x0b\x32$.google.cloud.secretmanager.v1.TopicB\x03\xe0\x41\x01\x12\x36\n\x0b\x65xpire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x00\x12-\n\x03ttl\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04H\x00\x12\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12>\n\x08rotation\x18\t \x01(\x0b\x32\'.google.cloud.secretmanager.v1.RotationB\x03\xe0\x41\x01\x12W\n\x0fversion_aliases\x18\x0b \x03(\x0b\x32\x39.google.cloud.secretmanager.v1.Secret.VersionAliasesEntryB\x03\xe0\x41\x01\x12P\n\x0b\x61nnotations\x18\r \x03(\x0b\x32\x36.google.cloud.secretmanager.v1.Secret.AnnotationsEntryB\x03\xe0\x41\x01\x12;\n\x13version_destroy_ttl\x18\x0e \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x0f \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x12H\n\x04tags\x18\x10 \x03(\x0b\x32/.google.cloud.secretmanager.v1.Secret.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x12M\n\x0bsecret_type\x18\x11 \x01(\x0e\x32\x30.google.cloud.secretmanager.v1.Secret.SecretTypeB\x06\xe0\x41\x05\xe0\x41\x01\x12?\n\rpolicy_member\x18\x12 \x01(\x0b\x32#.google.iam.v1.ResourcePolicyMemberB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x35\n\x13VersionAliasesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8d\x01\n\nSecretType\x12\x1b\n\x17SECRET_TYPE_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x43LOUD_SQL_DB_CREDENTIALS\x10\x01\x12\x0e\n\nACCESS_KEY\x10\x02\x12\x0f\n\x0b\x43\x45RTIFICATE\x10\x03\x12\x18\n\x14OTHER_DB_CREDENTIALS\x10\x04\x12\t\n\x05OTHER\x10\x32:\x99\x01\xea\x41\x95\x01\n#secretmanager.googleapis.com/Secret\x12#projects/{project}/secrets/{secret}\x12\x38projects/{project}/locations/{location}/secrets/{secret}*\x07secrets2\x06secretB\x0c\n\nexpiration\"\xc2\x06\n\rSecretVersion\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0c\x64\x65stroy_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x46\n\x05state\x18\x04 \x01(\x0e\x32\x32.google.cloud.secretmanager.v1.SecretVersion.StateB\x03\xe0\x41\x03\x12L\n\x12replication_status\x18\x05 \x01(\x0b\x32\x30.google.cloud.secretmanager.v1.ReplicationStatus\x12\x11\n\x04\x65tag\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12.\n!client_specified_payload_checksum\x18\x07 \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x16scheduled_destroy_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12h\n\x1b\x63ustomer_managed_encryption\x18\t \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\"H\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tDESTROYED\x10\x03:\xe2\x01\xea\x41\xde\x01\n*secretmanager.googleapis.com/SecretVersion\x12=projects/{project}/secrets/{secret}/versions/{secret_version}\x12Rprojects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}*\x0esecretVersions2\rsecretVersion\"\x90\x04\n\x0bReplication\x12I\n\tautomatic\x18\x01 \x01(\x0b\x32\x34.google.cloud.secretmanager.v1.Replication.AutomaticH\x00\x12N\n\x0cuser_managed\x18\x02 \x01(\x0b\x32\x36.google.cloud.secretmanager.v1.Replication.UserManagedH\x00\x1ao\n\tAutomatic\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x01 \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x1a\xe5\x01\n\x0bUserManaged\x12U\n\x08replicas\x18\x01 \x03(\x0b\x32>.google.cloud.secretmanager.v1.Replication.UserManaged.ReplicaB\x03\xe0\x41\x02\x1a\x7f\n\x07Replica\x12\x10\n\x08location\x18\x01 \x01(\t\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x02 \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x42\r\n\x0breplication\"6\n\x19\x43ustomerManagedEncryption\x12\x19\n\x0ckms_key_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xeb\x04\n\x11ReplicationStatus\x12U\n\tautomatic\x18\x01 \x01(\x0b\x32@.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatusH\x00\x12Z\n\x0cuser_managed\x18\x02 \x01(\x0b\x32\x42.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatusH\x00\x1a{\n\x0f\x41utomaticStatus\x12h\n\x1b\x63ustomer_managed_encryption\x18\x01 \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\x1a\x8f\x02\n\x11UserManagedStatus\x12g\n\x08replicas\x18\x01 \x03(\x0b\x32P.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatusB\x03\xe0\x41\x03\x1a\x90\x01\n\rReplicaStatus\x12\x15\n\x08location\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12h\n\x1b\x63ustomer_managed_encryption\x18\x02 \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\x42\x14\n\x12replication_status\"D\n\x1f\x43ustomerManagedEncryptionStatus\x12!\n\x14kms_key_version_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"_\n\x05Topic\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08:C\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}\"\xba\x03\n\x08Rotation\x12;\n\x12next_rotation_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12\x37\n\x0frotation_period\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04\x12\x63\n\x17managed_rotation_status\x18\x03 \x01(\x0b\x32=.google.cloud.secretmanager.v1.Rotation.ManagedRotationStatusB\x03\xe0\x41\x03\x1a\xd2\x01\n\x15ManagedRotationStatus\x12W\n\x05state\x18\x01 \x01(\x0e\x32\x43.google.cloud.secretmanager.v1.Rotation.ManagedRotationStatus.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08INACTIVE\x10\x02\"L\n\rSecretPayload\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\x1d\n\x0b\x64\x61ta_crc32c\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x0e\n\x0c_data_crc32cB\xe7\x01\n!com.google.cloud.secretmanager.v1B\x0eResourcesProtoP\x01ZGcloud.google.com/go/secretmanager/apiv1/secretmanagerpb;secretmanagerpb\xa2\x02\x03GSM\xaa\x02\x1dGoogle.Cloud.SecretManager.V1\xca\x02\x1dGoogle\\Cloud\\SecretManager\\V1\xea\x02 Google::Cloud::SecretManager::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module SecretManager + module V1 + Secret = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Secret").msgclass + Secret::SecretType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Secret.SecretType").enummodule + SecretVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.SecretVersion").msgclass + SecretVersion::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.SecretVersion.State").enummodule + Replication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication").msgclass + Replication::Automatic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication.Automatic").msgclass + Replication::UserManaged = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication.UserManaged").msgclass + Replication::UserManaged::Replica = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication.UserManaged.Replica").msgclass + CustomerManagedEncryption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.CustomerManagedEncryption").msgclass + ReplicationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.ReplicationStatus").msgclass + ReplicationStatus::AutomaticStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus").msgclass + ReplicationStatus::UserManagedStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus").msgclass + ReplicationStatus::UserManagedStatus::ReplicaStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus").msgclass + CustomerManagedEncryptionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus").msgclass + Topic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Topic").msgclass + Rotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Rotation").msgclass + Rotation::ManagedRotationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Rotation.ManagedRotationStatus").msgclass + Rotation::ManagedRotationStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Rotation.ManagedRotationStatus.State").enummodule + SecretPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.SecretPayload").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb new file mode 100644 index 000000000000..66de23a46f13 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/secretmanager/v1/service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/secretmanager/v1/resources_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n+google/cloud/secretmanager/v1/service.proto\x12\x1dgoogle.cloud.secretmanager.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/secretmanager/v1/resources.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x97\x01\n\x12ListSecretsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#secretmanager.googleapis.com/Secret\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\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"z\n\x13ListSecretsResponse\x12\x36\n\x07secrets\x18\x01 \x03(\x0b\x32%.google.cloud.secretmanager.v1.Secret\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\xa6\x01\n\x13\x43reateSecretRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#secretmanager.googleapis.com/Secret\x12\x16\n\tsecret_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\x06secret\x18\x03 \x01(\x0b\x32%.google.cloud.secretmanager.v1.SecretB\x03\xe0\x41\x02\"\x9a\x01\n\x17\x41\x64\x64SecretVersionRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x42\n\x07payload\x18\x02 \x01(\x0b\x32,.google.cloud.secretmanager.v1.SecretPayloadB\x03\xe0\x41\x02\"\xdc\x02\n\x1c\x45nableManagedRotationRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x86\x01\n!cloud_sql_single_user_credentials\x18\x02 \x01(\x0b\x32Y.google.cloud.secretmanager.v1.EnableManagedRotationRequest.CloudSQLSingleUserCredentialsH\x00\x1ag\n\x1d\x43loudSQLSingleUserCredentials\x12\x18\n\x0binstance_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08username\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08password\x18\x03 \x01(\tB\x03\xe0\x41\x01\x42\r\n\x0b\x63redentials\"R\n\x13RotateSecretRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\"M\n\x10GetSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\"\x9e\x01\n\x19ListSecretVersionsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\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\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x89\x01\n\x1aListSecretVersionsResponse\x12>\n\x08versions\x18\x01 \x03(\x0b\x32,.google.cloud.secretmanager.v1.SecretVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"[\n\x17GetSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x87\x01\n\x13UpdateSecretRequest\x12:\n\x06secret\x18\x01 \x01(\x0b\x32%.google.cloud.secretmanager.v1.SecretB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"^\n\x1a\x41\x63\x63\x65ssSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x9b\x01\n\x1b\x41\x63\x63\x65ssSecretVersionResponse\x12=\n\x04name\x18\x01 \x01(\tB/\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12=\n\x07payload\x18\x02 \x01(\x0b\x32,.google.cloud.secretmanager.v1.SecretPayload\"c\n\x13\x44\x65leteSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"r\n\x1b\x44isableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"q\n\x1a\x45nableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"r\n\x1b\x44\x65stroySecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x32\xa1!\n\x14SecretManagerService\x12\xd5\x01\n\x0bListSecrets\x12\x31.google.cloud.secretmanager.v1.ListSecretsRequest\x1a\x32.google.cloud.secretmanager.v1.ListSecretsResponse\"_\xda\x41\x06parent\x82\xd3\xe4\x93\x02P\x12\x1f/v1/{parent=projects/*}/secretsZ-\x12+/v1/{parent=projects/*/locations/*}/secrets\x12\xec\x01\n\x0c\x43reateSecret\x12\x32.google.cloud.secretmanager.v1.CreateSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"\x80\x01\xda\x41\x17parent,secret_id,secret\x82\xd3\xe4\x93\x02`\"\x1f/v1/{parent=projects/*}/secrets:\x06secretZ5\"+/v1/{parent=projects/*/locations/*}/secrets:\x06secret\x12\x82\x02\n\x10\x41\x64\x64SecretVersion\x12\x36.google.cloud.secretmanager.v1.AddSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x87\x01\xda\x41\x0eparent,payload\x82\xd3\xe4\x93\x02p\",/v1/{parent=projects/*/secrets/*}:addVersion:\x01*Z=\"8/v1/{parent=projects/*/locations/*/secrets/*}:addVersion:\x01*\x12\xc2\x01\n\tGetSecret\x12/.google.cloud.secretmanager.v1.GetSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"]\xda\x41\x04name\x82\xd3\xe4\x93\x02P\x12\x1f/v1/{name=projects/*/secrets/*}Z-\x12+/v1/{name=projects/*/locations/*/secrets/*}\x12\xf5\x01\n\x0cUpdateSecret\x12\x32.google.cloud.secretmanager.v1.UpdateSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"\x89\x01\xda\x41\x12secret,update_mask\x82\xd3\xe4\x93\x02n2&/v1/{secret.name=projects/*/secrets/*}:\x06secretZ<22/v1/{secret.name=projects/*/locations/*/secrets/*}:\x06secret\x12\xb9\x01\n\x0c\x44\x65leteSecret\x12\x32.google.cloud.secretmanager.v1.DeleteSecretRequest\x1a\x16.google.protobuf.Empty\"]\xda\x41\x04name\x82\xd3\xe4\x93\x02P*\x1f/v1/{name=projects/*/secrets/*}Z-*+/v1/{name=projects/*/locations/*/secrets/*}\x12\x80\x02\n\x12ListSecretVersions\x12\x38.google.cloud.secretmanager.v1.ListSecretVersionsRequest\x1a\x39.google.cloud.secretmanager.v1.ListSecretVersionsResponse\"u\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x66\x12*/v1/{parent=projects/*/secrets/*}/versionsZ8\x12\x36/v1/{parent=projects/*/locations/*/secrets/*}/versions\x12\xed\x01\n\x10GetSecretVersion\x12\x36.google.cloud.secretmanager.v1.GetSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"s\xda\x41\x04name\x82\xd3\xe4\x93\x02\x66\x12*/v1/{name=projects/*/secrets/*/versions/*}Z8\x12\x36/v1/{name=projects/*/locations/*/secrets/*/versions/*}\x12\x90\x02\n\x13\x41\x63\x63\x65ssSecretVersion\x12\x39.google.cloud.secretmanager.v1.AccessSecretVersionRequest\x1a:.google.cloud.secretmanager.v1.AccessSecretVersionResponse\"\x81\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02t\x12\x31/v1/{name=projects/*/secrets/*/versions/*}:accessZ?\x12=/v1/{name=projects/*/locations/*/secrets/*/versions/*}:access\x12\x8c\x02\n\x14\x44isableSecretVersion\x12:.google.cloud.secretmanager.v1.DisableSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x89\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02|\"2/v1/{name=projects/*/secrets/*/versions/*}:disable:\x01*ZC\">/v1/{name=projects/*/locations/*/secrets/*/versions/*}:disable:\x01*\x12\x88\x02\n\x13\x45nableSecretVersion\x12\x39.google.cloud.secretmanager.v1.EnableSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x87\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02z\"1/v1/{name=projects/*/secrets/*/versions/*}:enable:\x01*ZB\"=/v1/{name=projects/*/locations/*/secrets/*/versions/*}:enable:\x01*\x12\x8c\x02\n\x14\x44\x65stroySecretVersion\x12:.google.cloud.secretmanager.v1.DestroySecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x89\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02|\"2/v1/{name=projects/*/secrets/*/versions/*}:destroy:\x01*ZC\">/v1/{name=projects/*/locations/*/secrets/*/versions/*}:destroy:\x01*\x12\xc9\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"~\x82\xd3\xe4\x93\x02x\"0/v1/{resource=projects/*/secrets/*}:setIamPolicy:\x01*ZA\"\x12] + # 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/resources.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/resources.rb new file mode 100644 index 000000000000..a762800fd0bc --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/resources.rb @@ -0,0 +1,596 @@ +# 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 SecretManager + module V1 + # A {::Google::Cloud::SecretManager::V1::Secret Secret} is a logical secret whose + # value and versions can be accessed. + # + # A {::Google::Cloud::SecretManager::V1::Secret Secret} is made up of zero or more + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} that represent + # the secret data. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} in the format + # `projects/*/secrets/*`. + # @!attribute [rw] replication + # @return [::Google::Cloud::SecretManager::V1::Replication] + # Optional. Immutable. The replication policy of the secret data attached to + # the {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # The replication policy cannot be changed after the Secret has been created. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the + # {::Google::Cloud::SecretManager::V1::Secret Secret} was created. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels assigned to this Secret. + # + # Label keys must be between 1 and 63 characters long, have a UTF-8 encoding + # of maximum 128 bytes, and must conform to the following PCRE regular + # expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` + # + # Label values must be between 0 and 63 characters long, have a UTF-8 + # encoding of maximum 128 bytes, and must conform to the following PCRE + # regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` + # + # No more than 64 labels can be assigned to a given resource. + # @!attribute [rw] topics + # @return [::Array<::Google::Cloud::SecretManager::V1::Topic>] + # Optional. A list of up to 10 Pub/Sub topics to which messages are published + # when control plane operations are called on the secret or its versions. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp in UTC when the + # {::Google::Cloud::SecretManager::V1::Secret Secret} is scheduled to expire. + # This is always provided on output, regardless of what was sent on input. + # + # Note: The following fields are mutually exclusive: `expire_time`, `ttl`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # Input only. The TTL for the + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # Note: The following fields are mutually exclusive: `ttl`, `expire_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] etag + # @return [::String] + # Optional. Etag of the currently stored + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # @!attribute [rw] rotation + # @return [::Google::Cloud::SecretManager::V1::Rotation] + # Optional. Rotation policy attached to the + # {::Google::Cloud::SecretManager::V1::Secret Secret}. May be excluded if there is + # no rotation policy. + # @!attribute [rw] version_aliases + # @return [::Google::Protobuf::Map{::String => ::Integer}] + # Optional. Mapping from version alias to version name. + # + # A version alias is a string with a maximum length of 63 characters and can + # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) + # and underscore ('_') characters. An alias string must start with a + # letter and cannot be the string 'latest' or 'NEW'. + # No more than 50 aliases can be assigned to a given secret. + # + # Version-Alias pairs will be viewable via GetSecret and modifiable via + # UpdateSecret. Access by alias is only be supported on + # GetSecretVersion and AccessSecretVersion. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Custom metadata about the secret. + # + # Annotations are distinct from various forms of labels. + # Annotations exist to allow client tools to store their own state + # information without requiring a database. + # + # Annotation keys must be between 1 and 63 characters long, have a UTF-8 + # encoding of maximum 128 bytes, begin and end with an alphanumeric character + # ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and + # alphanumerics in between these symbols. + # + # The total size of annotation keys and values must be less than 16KiB. + # @!attribute [rw] version_destroy_ttl + # @return [::Google::Protobuf::Duration] + # Optional. Secret Version TTL after destruction request + # + # This is a part of the Delayed secret version destroy feature. + # For secret with TTL>0, version destruction doesn't happen immediately + # on calling destroy instead the version goes to a disabled state and + # destruction happens after the TTL expires. + # @!attribute [rw] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryption] + # Optional. The customer-managed encryption configuration of the regionalized + # secrets. If no configuration is provided, Google-managed default encryption + # is used. + # + # Updates to the {::Google::Cloud::SecretManager::V1::Secret Secret} encryption + # configuration only apply to + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} added + # afterwards. They do not apply retroactively to existing + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. + # @!attribute [rw] tags + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Input only. Immutable. Mapping of Tag keys/values directly bound + # to this resource. For example: + # "123/environment": "production", + # "123/costCenter": "marketing" + # + # Tags are used to organize and group resources. + # + # Tags can be used to control policy evaluation for the resource. + # @!attribute [rw] secret_type + # @return [::Google::Cloud::SecretManager::V1::Secret::SecretType] + # Optional. Immutable. This defines the type of the secret. + # Enforces certain structural requirements on the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. + # For secret of type UNSPECIFIED, the SecretVersions can be of any type. + # @!attribute [r] policy_member + # @return [::Google::Iam::V1::ResourcePolicyMember] + # Output only. Defines the policy member for the secret. + # This will be used to check if the caller has the permission to perform + # certain operations on the typed secret. + class Secret + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Integer] + class VersionAliasesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class TagsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This defines the various values of the type of secret can be. + module SecretType + # Applicable to all secrets which do not have any restriction on the + # SecretVersions. + SECRET_TYPE_UNSPECIFIED = 0 + + # Applicable to secrets which are used for the managed rotation feature + # for Cloud SQL Single User. + CLOUD_SQL_DB_CREDENTIALS = 1 + + # Applicable to secrets where the payload contains an access key. + ACCESS_KEY = 2 + + # Applicable to secrets where the payload contains a certificate. + CERTIFICATE = 3 + + # Applicable to secrets where the payload contains database credentials. + OTHER_DB_CREDENTIALS = 4 + + # Applicable to secrets whose type doesn't belong to any of the above + # defined types. + OTHER = 50 + end + end + + # A secret version resource in the Secret Manager API. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*`. + # + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} IDs in a + # {::Google::Cloud::SecretManager::V1::Secret Secret} start at 1 and are + # incremented for each subsequent version of the secret. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} was created. + # @!attribute [r] destroy_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time this + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} was destroyed. + # Only present if {::Google::Cloud::SecretManager::V1::SecretVersion#state state} + # is + # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DESTROYED DESTROYED}. + # @!attribute [r] state + # @return [::Google::Cloud::SecretManager::V1::SecretVersion::State] + # Output only. The current state of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @!attribute [rw] replication_status + # @return [::Google::Cloud::SecretManager::V1::ReplicationStatus] + # The replication status of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @!attribute [r] etag + # @return [::String] + # Output only. Etag of the currently stored + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @!attribute [r] client_specified_payload_checksum + # @return [::Boolean] + # Output only. True if payload checksum specified in + # {::Google::Cloud::SecretManager::V1::SecretPayload SecretPayload} object has + # been received by + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client SecretManagerService} + # on + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion}. + # @!attribute [r] scheduled_destroy_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Output only. Scheduled destroy time for secret version. + # This is a part of the Delayed secret version destroy feature. For a + # Secret with a valid version destroy TTL, when a secert version is + # destroyed, version is moved to disabled state and it is scheduled for + # destruction Version is destroyed only after the scheduled_destroy_time. + # @!attribute [r] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryptionStatus] + # Output only. The customer-managed encryption status of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. Only + # populated if customer-managed encryption is used and + # {::Google::Cloud::SecretManager::V1::Secret Secret} is a regionalized secret. + class SecretVersion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The state of a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}, indicating if + # it can be accessed. + module State + # Not specified. This value is unused and invalid. + STATE_UNSPECIFIED = 0 + + # The {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} may be + # accessed. + ENABLED = 1 + + # The {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} may not + # be accessed, but the secret data is still available and can be placed + # back into the + # {::Google::Cloud::SecretManager::V1::SecretVersion::State::ENABLED ENABLED} + # state. + DISABLED = 2 + + # The {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} is + # destroyed and the secret data is no longer stored. A version may not + # leave this state once entered. + DESTROYED = 3 + end + end + + # A policy that defines the replication and encryption configuration of data. + # @!attribute [rw] automatic + # @return [::Google::Cloud::SecretManager::V1::Replication::Automatic] + # The {::Google::Cloud::SecretManager::V1::Secret Secret} will automatically be + # replicated without any restrictions. + # + # Note: The following fields are mutually exclusive: `automatic`, `user_managed`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] user_managed + # @return [::Google::Cloud::SecretManager::V1::Replication::UserManaged] + # The {::Google::Cloud::SecretManager::V1::Secret Secret} will only be + # replicated into the locations specified. + # + # Note: The following fields are mutually exclusive: `user_managed`, `automatic`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Replication + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A replication policy that replicates the + # {::Google::Cloud::SecretManager::V1::Secret Secret} payload without any + # restrictions. + # @!attribute [rw] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryption] + # Optional. The customer-managed encryption configuration of the + # {::Google::Cloud::SecretManager::V1::Secret Secret}. If no configuration is + # provided, Google-managed default encryption is used. + # + # Updates to the {::Google::Cloud::SecretManager::V1::Secret Secret} encryption + # configuration only apply to + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} added + # afterwards. They do not apply retroactively to existing + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. + class Automatic + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A replication policy that replicates the + # {::Google::Cloud::SecretManager::V1::Secret Secret} payload into the locations + # specified in + # {::Google::Cloud::SecretManager::V1::Replication::UserManaged#replicas Replication.UserManaged.replicas} + # @!attribute [rw] replicas + # @return [::Array<::Google::Cloud::SecretManager::V1::Replication::UserManaged::Replica>] + # Required. The list of Replicas for this + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # + # Cannot be empty. + class UserManaged + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a Replica for this + # {::Google::Cloud::SecretManager::V1::Secret Secret}. + # @!attribute [rw] location + # @return [::String] + # The canonical IDs of the location to replicate data. + # For example: `"us-east1"`. + # @!attribute [rw] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryption] + # Optional. The customer-managed encryption configuration of the + # [User-Managed Replica][Replication.UserManaged.Replica]. If no + # configuration is provided, Google-managed default encryption is used. + # + # Updates to the {::Google::Cloud::SecretManager::V1::Secret Secret} + # encryption configuration only apply to + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} added + # afterwards. They do not apply retroactively to existing + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. + class Replica + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Configuration for encrypting secret payloads using customer-managed + # encryption keys (CMEK). + # @!attribute [rw] kms_key_name + # @return [::String] + # Required. The resource name of the Cloud KMS CryptoKey used to encrypt + # secret payloads. + # + # For secrets using the + # {::Google::Cloud::SecretManager::V1::Replication::UserManaged UserManaged} + # replication policy type, Cloud KMS CryptoKeys must reside in the same + # location as the [replica location][Secret.UserManaged.Replica.location]. + # + # For secrets using the + # {::Google::Cloud::SecretManager::V1::Replication::Automatic Automatic} + # replication policy type, Cloud KMS CryptoKeys must reside in `global`. + # + # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + class CustomerManagedEncryption + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The replication status of a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @!attribute [rw] automatic + # @return [::Google::Cloud::SecretManager::V1::ReplicationStatus::AutomaticStatus] + # Describes the replication status of a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} with + # automatic replication. + # + # Only populated if the parent + # {::Google::Cloud::SecretManager::V1::Secret Secret} has an automatic + # replication policy. + # + # Note: The following fields are mutually exclusive: `automatic`, `user_managed`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] user_managed + # @return [::Google::Cloud::SecretManager::V1::ReplicationStatus::UserManagedStatus] + # Describes the replication status of a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} with + # user-managed replication. + # + # Only populated if the parent + # {::Google::Cloud::SecretManager::V1::Secret Secret} has a user-managed + # replication policy. + # + # Note: The following fields are mutually exclusive: `user_managed`, `automatic`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ReplicationStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The replication status of a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} using + # automatic replication. + # + # Only populated if the parent {::Google::Cloud::SecretManager::V1::Secret Secret} + # has an automatic replication policy. + # @!attribute [r] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryptionStatus] + # Output only. The customer-managed encryption status of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. Only + # populated if customer-managed encryption is used. + class AutomaticStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The replication status of a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} using + # user-managed replication. + # + # Only populated if the parent {::Google::Cloud::SecretManager::V1::Secret Secret} + # has a user-managed replication policy. + # @!attribute [r] replicas + # @return [::Array<::Google::Cloud::SecretManager::V1::ReplicationStatus::UserManagedStatus::ReplicaStatus>] + # Output only. The list of replica statuses for the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + class UserManagedStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes the status of a user-managed replica for the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @!attribute [r] location + # @return [::String] + # Output only. The canonical ID of the replica location. + # For example: `"us-east1"`. + # @!attribute [r] customer_managed_encryption + # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryptionStatus] + # Output only. The customer-managed encryption status of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. Only + # populated if customer-managed encryption is used. + class ReplicaStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Describes the status of customer-managed encryption. + # @!attribute [rw] kms_key_version_name + # @return [::String] + # Required. The resource name of the Cloud KMS CryptoKeyVersion used to + # encrypt the secret payload, in the following format: + # `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`. + class CustomerManagedEncryptionStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Pub/Sub topic which Secret Manager will publish to when control plane + # events occur on this secret. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the Pub/Sub topic that will be published + # to, in the following format: `projects/*/topics/*`. For publication to + # succeed, the Secret Manager service agent must have the + # `pubsub.topic.publish` permission on the topic. The Pub/Sub Publisher role + # (`roles/pubsub.publisher`) includes this permission. + class Topic + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The rotation time and period for a + # {::Google::Cloud::SecretManager::V1::Secret Secret}. At next_rotation_time, Secret + # Manager will send a Pub/Sub notification to the topics configured on the + # Secret. {::Google::Cloud::SecretManager::V1::Secret#topics Secret.topics} must be + # set to configure rotation. + # @!attribute [rw] next_rotation_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Timestamp in UTC at which the + # {::Google::Cloud::SecretManager::V1::Secret Secret} is scheduled to rotate. + # Cannot be set to less than 300s (5 min) in the future and at most + # 3153600000s (100 years). + # + # {::Google::Cloud::SecretManager::V1::Rotation#next_rotation_time next_rotation_time} + # MUST be set if + # {::Google::Cloud::SecretManager::V1::Rotation#rotation_period rotation_period} + # is set. + # @!attribute [rw] rotation_period + # @return [::Google::Protobuf::Duration] + # Input only. The Duration between rotation notifications. Must be in seconds + # and at least 3600s (1h) and at most 3153600000s (100 years). + # + # If + # {::Google::Cloud::SecretManager::V1::Rotation#rotation_period rotation_period} + # is set, + # {::Google::Cloud::SecretManager::V1::Rotation#next_rotation_time next_rotation_time} + # must be set. + # {::Google::Cloud::SecretManager::V1::Rotation#next_rotation_time next_rotation_time} + # will be advanced by this period when the service automatically sends + # rotation notifications. + # @!attribute [r] managed_rotation_status + # @return [::Google::Cloud::SecretManager::V1::Rotation::ManagedRotationStatus] + # Output only. The current status of the managed rotation. + # This field is only applicable to Typed Secrets. + # This field is set by the service and cannot be set by the user. + class Rotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents the status of a managed rotation. + # + # This is applicable only to Typed Secrets. It indicates whether the + # rotation is active and any errors that may have occurred during the + # asynchronous managed rotation. + # @!attribute [r] state + # @return [::Google::Cloud::SecretManager::V1::Rotation::ManagedRotationStatus::State] + # Output only. Indicates whether the Managed Rotation is active or not. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Displays customer-facing issues that occurred during an + # asynchronous managed rotation. For example, if there are some permission + # errors. + class ManagedRotationStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # This defines the various states in which the managed rotation can be. + module State + # Not specified. This value is unused and invalid. + STATE_UNSPECIFIED = 0 + + # Indicates that the Managed rotation is ACTIVE. + ACTIVE = 1 + + # Indicates that the Managed rotation is INACTIVE. + INACTIVE = 2 + end + end + end + + # A secret payload resource in the Secret Manager API. This contains the + # sensitive secret payload that is associated with a + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + # @!attribute [rw] data + # @return [::String] + # The secret data. Must be no larger than 64KiB. + # @!attribute [rw] data_crc32c + # @return [::Integer] + # Optional. If specified, + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client SecretManagerService} + # will verify the integrity of the received + # {::Google::Cloud::SecretManager::V1::SecretPayload#data data} on + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion} + # calls using the crc32c checksum and store it to include in future + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion} + # responses. If a checksum is not provided in the + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion} + # request, the + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client SecretManagerService} + # will generate and store one for you. + # + # The CRC32C value is encoded as a Int64 for compatibility, and can be + # safely downconverted to uint32 in languages that support this type. + # https://cloud.google.com/apis/design/design_patterns#integer_types + class SecretPayload + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/service.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/service.rb new file mode 100644 index 000000000000..8066f3be91af --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/service.rb @@ -0,0 +1,366 @@ +# 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 SecretManager + module V1 + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets SecretManagerService.ListSecrets}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the project associated with the + # {::Google::Cloud::SecretManager::V1::Secret Secrets}, in the format `projects/*` + # or `projects/*/locations/*` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # {::Google::Cloud::SecretManager::V1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secrets matching the filter. If filter is empty, all secrets are + # listed. + class ListSecretsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets SecretManagerService.ListSecrets}. + # @!attribute [rw] secrets + # @return [::Array<::Google::Cloud::SecretManager::V1::Secret>] + # The list of {::Google::Cloud::SecretManager::V1::Secret Secrets} sorted in + # reverse by create_time (newest first). + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Pass this value in + # {::Google::Cloud::SecretManager::V1::ListSecretsRequest#page_token ListSecretsRequest.page_token} + # to retrieve the next page. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of {::Google::Cloud::SecretManager::V1::Secret Secrets} but 0 + # when the + # {::Google::Cloud::SecretManager::V1::ListSecretsRequest#filter ListSecretsRequest.filter} + # field is set. + class ListSecretsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#create_secret SecretManagerService.CreateSecret}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the project to associate with the + # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format `projects/*` + # or `projects/*/locations/*`. + # @!attribute [rw] secret_id + # @return [::String] + # Required. This must be unique within the project. + # + # A secret ID is a string with a maximum length of 255 characters and can + # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and + # underscore (`_`) characters. + # @!attribute [rw] secret + # @return [::Google::Cloud::SecretManager::V1::Secret] + # Required. A {::Google::Cloud::SecretManager::V1::Secret Secret} with initial + # field values. + class CreateSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @!attribute [rw] payload + # @return [::Google::Cloud::SecretManager::V1::SecretPayload] + # Required. The secret payload of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + class AddSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_managed_rotation SecretManagerService.EnableManagedRotation}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @!attribute [rw] cloud_sql_single_user_credentials + # @return [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest::CloudSQLSingleUserCredentials] + # Credentials required for Cloud SQL DB for Single user Managed Rotation. + class EnableManagedRotationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # These are the credentials required for Cloud SQL DB for Single user + # Managed Rotation. + # @!attribute [rw] instance_id + # @return [::String] + # Required. Instance ID of the Cloud SQL instance. + # @!attribute [rw] username + # @return [::String] + # Required. Username of the Cloud SQL instance. + # @!attribute [rw] password + # @return [::String] + # Optional. Password of the Cloud SQL instance. If this is not provided, + # a random password will be generated. + class CloudSQLSingleUserCredentials + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#rotate_secret SecretManagerService.RotateSecret}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + class RotateSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret SecretManagerService.GetSecret}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + class GetSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions SecretManagerService.ListSecretVersions}. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} associated with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} to list, in + # the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of results to be returned in a single page. If + # set to 0, the server decides the number of results to return. If the + # number is greater than 25000, it is capped at 25000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. Pagination token, returned earlier via + # ListSecretVersionsResponse.next_page_token][]. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filter string, adhering to the rules in + # [List-operation + # filtering](https://cloud.google.com/secret-manager/docs/filtering). List + # only secret versions matching the filter. If filter is empty, all secret + # versions are listed. + class ListSecretVersionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions SecretManagerService.ListSecretVersions}. + # @!attribute [rw] versions + # @return [::Array<::Google::Cloud::SecretManager::V1::SecretVersion>] + # The list of {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} + # sorted in reverse by create_time (newest first). + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve the next page of results. Pass this value in + # {::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest#page_token ListSecretVersionsRequest.page_token} + # to retrieve the next page. + # @!attribute [rw] total_size + # @return [::Integer] + # The total number of + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} but 0 when + # the + # {::Google::Cloud::SecretManager::V1::ListSecretsRequest#filter ListSecretsRequest.filter} + # field is set. + class ListSecretVersionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret_version SecretManagerService.GetSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + class GetSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#update_secret SecretManagerService.UpdateSecret}. + # @!attribute [rw] secret + # @return [::Google::Cloud::SecretManager::V1::Secret] + # Required. {::Google::Cloud::SecretManager::V1::Secret Secret} with updated field + # values. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Specifies the fields to be updated. + class UpdateSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # + # `projects/*/secrets/*/versions/latest` or + # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most + # recently created + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. + class AccessSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @!attribute [rw] payload + # @return [::Google::Cloud::SecretManager::V1::SecretPayload] + # Secret payload + class AccessSecretVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#delete_secret SecretManagerService.DeleteSecret}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to delete in the format + # `projects/*/secrets/*`. + # @!attribute [rw] etag + # @return [::String] + # Optional. Etag of the {::Google::Cloud::SecretManager::V1::Secret Secret}. The + # request succeeds if it matches the etag of the currently stored secret + # object. If the etag is omitted, the request succeeds. + class DeleteSecretRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#disable_secret_version SecretManagerService.DisableSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to disable in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @!attribute [rw] etag + # @return [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + class DisableSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_secret_version SecretManagerService.EnableSecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to enable in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @!attribute [rw] etag + # @return [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + class EnableSecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#destroy_secret_version SecretManagerService.DestroySecretVersion}. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to destroy in + # the format `projects/*/secrets/*/versions/*` or + # `projects/*/locations/*/secrets/*/versions/*`. + # @!attribute [rw] etag + # @return [::String] + # Optional. Etag of the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request + # succeeds if it matches the etag of the currently stored secret version + # object. If the etag is omitted, the request succeeds. + class DestroySecretVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/iam/v1/resource_policy_member.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/resource_policy_member.rb new file mode 100644 index 000000000000..5f60d79049ba --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/resource_policy_member.rb @@ -0,0 +1,49 @@ +# 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 + # Output-only policy member strings of a Google Cloud resource's built-in + # identity. + # @!attribute [r] iam_policy_name_principal + # @return [::String] + # IAM policy binding member referring to a Google Cloud resource by + # user-assigned name (https://google.aip.dev/122). If a resource is deleted + # and recreated with the same name, the binding will be applicable to the new + # resource. + # + # Example: + # `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter` + # @!attribute [r] iam_policy_uid_principal + # @return [::String] + # IAM policy binding member referring to a Google Cloud resource by + # system-assigned unique identifier (https://google.aip.dev/148#uid). If a + # resource is deleted and recreated with the same name, the binding will not + # be applicable to the new resource + # + # Example: + # `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5` + class ResourcePolicyMember + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/Gemfile new file mode 100644 index 000000000000..714e81d5760e --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1", path: "../" +else + gem "google-cloud-secret_manager-v1" +end + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb new file mode 100644 index 000000000000..dae0739c31ec --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.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 secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the access_secret_version call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#access_secret_version. +# +def access_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new + + # Call the access_secret_version method. + result = client.access_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1::AccessSecretVersionResponse. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb new file mode 100644 index 000000000000..7167e1195230 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.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 secretmanager_v1_generated_SecretManagerService_AddSecretVersion_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the add_secret_version call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#add_secret_version. +# +def add_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new + + # Call the add_secret_version method. + result = client.add_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_AddSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb new file mode 100644 index 000000000000..18e84e0e0cf6 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.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 secretmanager_v1_generated_SecretManagerService_CreateSecret_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the create_secret call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#create_secret. +# +def create_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::CreateSecretRequest.new + + # Call the create_secret method. + result = client.create_secret request + + # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_CreateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb new file mode 100644 index 000000000000..d2cda7727281 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.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 secretmanager_v1_generated_SecretManagerService_DeleteSecret_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the delete_secret call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#delete_secret. +# +def delete_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::DeleteSecretRequest.new + + # Call the delete_secret method. + result = client.delete_secret request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_DeleteSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb new file mode 100644 index 000000000000..f2a4956d1bfa --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.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 secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the destroy_secret_version call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#destroy_secret_version. +# +def destroy_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new + + # Call the destroy_secret_version method. + result = client.destroy_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb new file mode 100644 index 000000000000..2acddd330453 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.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 secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the disable_secret_version call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#disable_secret_version. +# +def disable_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new + + # Call the disable_secret_version method. + result = client.disable_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_managed_rotation.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_managed_rotation.rb new file mode 100644 index 000000000000..3d574129a565 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_managed_rotation.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 secretmanager_v1_generated_SecretManagerService_EnableManagedRotation_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the enable_managed_rotation call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#enable_managed_rotation. +# +def enable_managed_rotation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new + + # Call the enable_managed_rotation method. + result = client.enable_managed_rotation request + + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_EnableManagedRotation_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb new file mode 100644 index 000000000000..124945e6f241 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.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 secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the enable_secret_version call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#enable_secret_version. +# +def enable_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new + + # Call the enable_secret_version method. + result = client.enable_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb new file mode 100644 index 000000000000..939129c0ed81 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/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 secretmanager_v1_generated_SecretManagerService_GetIamPolicy_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the get_iam_policy call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::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 secretmanager_v1_generated_SecretManagerService_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb new file mode 100644 index 000000000000..d63674176991 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.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 secretmanager_v1_generated_SecretManagerService_GetSecret_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the get_secret call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#get_secret. +# +def get_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::GetSecretRequest.new + + # Call the get_secret method. + result = client.get_secret request + + # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_GetSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb new file mode 100644 index 000000000000..d784f543ecf2 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.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 secretmanager_v1_generated_SecretManagerService_GetSecretVersion_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the get_secret_version call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#get_secret_version. +# +def get_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new + + # Call the get_secret_version method. + result = client.get_secret_version request + + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_GetSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb new file mode 100644 index 000000000000..1e197877f1eb --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.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 secretmanager_v1_generated_SecretManagerService_ListSecretVersions_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the list_secret_versions call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#list_secret_versions. +# +def list_secret_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new + + # Call the list_secret_versions method. + result = client.list_secret_versions 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::SecretManager::V1::SecretVersion. + p item + end +end +# [END secretmanager_v1_generated_SecretManagerService_ListSecretVersions_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb new file mode 100644 index 000000000000..42e277c580e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.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 secretmanager_v1_generated_SecretManagerService_ListSecrets_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the list_secrets call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#list_secrets. +# +def list_secrets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::ListSecretsRequest.new + + # Call the list_secrets method. + result = client.list_secrets 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::SecretManager::V1::Secret. + p item + end +end +# [END secretmanager_v1_generated_SecretManagerService_ListSecrets_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/rotate_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/rotate_secret.rb new file mode 100644 index 000000000000..4cf1f3b0f21b --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/rotate_secret.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 secretmanager_v1_generated_SecretManagerService_RotateSecret_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the rotate_secret call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#rotate_secret. +# +def rotate_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::RotateSecretRequest.new + + # Call the rotate_secret method. + result = client.rotate_secret request + + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_RotateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb new file mode 100644 index 000000000000..54b76b5acc8c --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/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 secretmanager_v1_generated_SecretManagerService_SetIamPolicy_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the set_iam_policy call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::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 secretmanager_v1_generated_SecretManagerService_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb new file mode 100644 index 000000000000..5b817c93d9c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/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 secretmanager_v1_generated_SecretManagerService_TestIamPermissions_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the test_iam_permissions call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::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 secretmanager_v1_generated_SecretManagerService_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb new file mode 100644 index 000000000000..c9d6041cca95 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.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 secretmanager_v1_generated_SecretManagerService_UpdateSecret_sync] +require "google/cloud/secret_manager/v1" + +## +# Snippet for the update_secret call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#update_secret. +# +def update_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::UpdateSecretRequest.new + + # Call the update_secret method. + result = client.update_secret request + + # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + p result +end +# [END secretmanager_v1_generated_SecretManagerService_UpdateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json new file mode 100644 index 000000000000..3258c0ed200c --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json @@ -0,0 +1,695 @@ +{ + "client_library": { + "name": "google-cloud-secret_manager-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.secretmanager.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_ListSecrets_sync", + "title": "Snippet for the list_secrets call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets.", + "file": "secret_manager_service/list_secrets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_secrets", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::ListSecretsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::ListSecretsResponse", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "ListSecrets", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.ListSecrets", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_CreateSecret_sync", + "title": "Snippet for the create_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#create_secret.", + "file": "secret_manager_service/create_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_secret", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#create_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::CreateSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::Secret", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "CreateSecret", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.CreateSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_AddSecretVersion_sync", + "title": "Snippet for the add_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version.", + "file": "secret_manager_service/add_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::AddSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "AddSecretVersion", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.AddSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_GetSecret_sync", + "title": "Snippet for the get_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret.", + "file": "secret_manager_service/get_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_secret", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::GetSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::Secret", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "GetSecret", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.GetSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_UpdateSecret_sync", + "title": "Snippet for the update_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#update_secret.", + "file": "secret_manager_service/update_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_secret", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#update_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::UpdateSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::Secret", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "UpdateSecret", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.UpdateSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_DeleteSecret_sync", + "title": "Snippet for the delete_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#delete_secret.", + "file": "secret_manager_service/delete_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_secret", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#delete_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::DeleteSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "DeleteSecret", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.DeleteSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_ListSecretVersions_sync", + "title": "Snippet for the list_secret_versions call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions.", + "file": "secret_manager_service/list_secret_versions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_secret_versions", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "ListSecretVersions", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.ListSecretVersions", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_GetSecretVersion_sync", + "title": "Snippet for the get_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret_version.", + "file": "secret_manager_service/get_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::GetSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "GetSecretVersion", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.GetSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_sync", + "title": "Snippet for the access_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version.", + "file": "secret_manager_service/access_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "access_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "AccessSecretVersion", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.AccessSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_sync", + "title": "Snippet for the disable_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#disable_secret_version.", + "file": "secret_manager_service/disable_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "disable_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#disable_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "DisableSecretVersion", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.DisableSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_sync", + "title": "Snippet for the enable_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_secret_version.", + "file": "secret_manager_service/enable_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "enable_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "EnableSecretVersion", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.EnableSecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_sync", + "title": "Snippet for the destroy_secret_version call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#destroy_secret_version.", + "file": "secret_manager_service/destroy_secret_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "destroy_secret_version", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#destroy_secret_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "DestroySecretVersion", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.DestroySecretVersion", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#set_iam_policy.", + "file": "secret_manager_service/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.SetIamPolicy", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_iam_policy.", + "file": "secret_manager_service/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.GetIamPolicy", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#test_iam_permissions.", + "file": "secret_manager_service/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.TestIamPermissions", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_EnableManagedRotation_sync", + "title": "Snippet for the enable_managed_rotation call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_managed_rotation.", + "file": "secret_manager_service/enable_managed_rotation.rb", + "language": "RUBY", + "client_method": { + "short_name": "enable_managed_rotation", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_managed_rotation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "EnableManagedRotation", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.EnableManagedRotation", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "secretmanager_v1_generated_SecretManagerService_RotateSecret_sync", + "title": "Snippet for the rotate_secret call in the SecretManagerService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#rotate_secret.", + "file": "secret_manager_service/rotate_secret.rb", + "language": "RUBY", + "client_method": { + "short_name": "rotate_secret", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#rotate_secret", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::SecretManager::V1::RotateSecretRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", + "client": { + "short_name": "SecretManagerService::Client", + "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" + }, + "method": { + "short_name": "RotateSecret", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService.RotateSecret", + "service": { + "short_name": "SecretManagerService", + "full_name": "google.cloud.secretmanager.v1.SecretManagerService" + } + } + }, + "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-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb new file mode 100644 index 000000000000..7ec6d9553efe --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb @@ -0,0 +1,109 @@ +# 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/secret_manager/v1/secret_manager_service" + +class ::Google::Cloud::SecretManager::V1::SecretManagerService::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_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_secret_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.secret_path project: "value0", secret: "value1" + assert_equal "projects/value0/secrets/value1", path + + path = client.secret_path project: "value0", location: "value1", secret: "value2" + assert_equal "projects/value0/locations/value1/secrets/value2", path + end + end + + def test_secret_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.secret_version_path project: "value0", secret: "value1", secret_version: "value2" + assert_equal "projects/value0/secrets/value1/versions/value2", path + + path = client.secret_version_path project: "value0", location: "value1", secret: "value2", secret_version: "value3" + assert_equal "projects/value0/locations/value1/secrets/value2/versions/value3", path + end + end + + def test_topic_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.topic_path project: "value0", topic: "value1" + assert_equal "projects/value0/topics/value1", path + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb new file mode 100644 index 000000000000..b55d10d9aadb --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb @@ -0,0 +1,1036 @@ +# 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/cloud/secretmanager/v1/service_pb" +require "google/cloud/secret_manager/v1/secret_manager_service/rest" + + +class ::Google::Cloud::SecretManager::V1::SecretManagerService::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_list_secrets + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::ListSecretsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_secrets_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_list_secrets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_secrets_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_secrets parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_secrets ::Google::Cloud::SecretManager::V1::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_secrets(::Google::Cloud::SecretManager::V1::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_secrets_client_stub.call_count + end + end + end + + def test_create_secret + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::Secret.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + secret_id = "hello world" + secret = {} + + create_secret_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_create_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_secret_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.create_secret({ parent: parent, secret_id: secret_id, secret: secret }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.create_secret parent: parent, secret_id: secret_id, secret: secret do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.create_secret ::Google::Cloud::SecretManager::V1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.create_secret({ parent: parent, secret_id: secret_id, secret: secret }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.create_secret(::Google::Cloud::SecretManager::V1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_secret_client_stub.call_count + end + end + end + + def test_add_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + payload = {} + + add_secret_version_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_add_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_secret_version_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.add_secret_version({ parent: parent, payload: payload }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.add_secret_version parent: parent, payload: payload do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.add_secret_version ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new(parent: parent, payload: payload) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.add_secret_version({ parent: parent, payload: payload }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.add_secret_version(::Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new(parent: parent, payload: payload), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_secret_version_client_stub.call_count + end + end + end + + def test_get_secret + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::Secret.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_secret_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_secret_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_secret({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_secret name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_secret ::Google::Cloud::SecretManager::V1::GetSecretRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_secret({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_secret(::Google::Cloud::SecretManager::V1::GetSecretRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_secret_client_stub.call_count + end + end + end + + def test_update_secret + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::Secret.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + secret = {} + update_mask = {} + + update_secret_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_update_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_secret_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.update_secret({ secret: secret, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.update_secret secret: secret, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.update_secret ::Google::Cloud::SecretManager::V1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.update_secret({ secret: secret, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.update_secret(::Google::Cloud::SecretManager::V1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_secret_client_stub.call_count + end + end + end + + def test_delete_secret + # Create test objects. + client_result = ::Google::Protobuf::Empty.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + delete_secret_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_delete_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_secret_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.delete_secret({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.delete_secret name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.delete_secret ::Google::Cloud::SecretManager::V1::DeleteSecretRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.delete_secret({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.delete_secret(::Google::Cloud::SecretManager::V1::DeleteSecretRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_secret_client_stub.call_count + end + end + end + + def test_list_secret_versions + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + list_secret_versions_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_list_secret_versions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_secret_versions_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.list_secret_versions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.list_secret_versions ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.list_secret_versions(::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_secret_versions_client_stub.call_count + end + end + end + + def test_get_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_secret_version_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_secret_version_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_secret_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_secret_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.get_secret_version ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.get_secret_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.get_secret_version(::Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_secret_version_client_stub.call_count + end + end + end + + def test_access_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + access_secret_version_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_access_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, access_secret_version_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.access_secret_version({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.access_secret_version name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.access_secret_version ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.access_secret_version({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.access_secret_version(::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, access_secret_version_client_stub.call_count + end + end + end + + def test_disable_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + disable_secret_version_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_disable_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, disable_secret_version_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.disable_secret_version({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.disable_secret_version name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.disable_secret_version ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.disable_secret_version({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.disable_secret_version(::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, disable_secret_version_client_stub.call_count + end + end + end + + def test_enable_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + enable_secret_version_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_enable_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, enable_secret_version_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.enable_secret_version({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.enable_secret_version name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.enable_secret_version ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.enable_secret_version({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.enable_secret_version(::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, enable_secret_version_client_stub.call_count + end + end + end + + def test_destroy_secret_version + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + + destroy_secret_version_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_destroy_secret_version_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, destroy_secret_version_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.destroy_secret_version({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.destroy_secret_version name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.destroy_secret_version ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.destroy_secret_version({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.destroy_secret_version(::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, destroy_secret_version_client_stub.call_count + end + end + end + + def test_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.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 + c.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 + c.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::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.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 + c.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 + c.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_enable_managed_rotation + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + cloud_sql_single_user_credentials = {} + + enable_managed_rotation_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_enable_managed_rotation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, enable_managed_rotation_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.enable_managed_rotation({ parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.enable_managed_rotation parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.enable_managed_rotation ::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new(parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.enable_managed_rotation({ parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.enable_managed_rotation(::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new(parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, enable_managed_rotation_client_stub.call_count + end + end + end + + def test_rotate_secret + # Create test objects. + client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + rotate_secret_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_rotate_secret_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, rotate_secret_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + c.rotate_secret({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + c.rotate_secret parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + c.rotate_secret ::Google::Cloud::SecretManager::V1::RotateSecretRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + c.rotate_secret({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + c.rotate_secret(::Google::Cloud::SecretManager::V1::RotateSecretRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, rotate_secret_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::SecretManager::V1::SecretManagerService::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::SecretManager::V1::SecretManagerService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb new file mode 100644 index 000000000000..d36073a4798f --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb @@ -0,0 +1,1139 @@ +# 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/secretmanager/v1/service_pb" +require "google/cloud/secret_manager/v1/secret_manager_service" + +class ::Google::Cloud::SecretManager::V1::SecretManagerService::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_list_secrets + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::ListSecretsResponse.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" + filter = "hello world" + + list_secrets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_secrets, name + assert_kind_of ::Google::Cloud::SecretManager::V1::ListSecretsRequest, 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["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_secrets_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_secrets parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_secrets ::Google::Cloud::SecretManager::V1::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) 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 + c.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, 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 + c.list_secrets(::Google::Cloud::SecretManager::V1::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), 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_secrets_client_stub.call_rpc_count + end + end + + def test_create_secret + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::Secret.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" + secret_id = "hello world" + secret = {} + + create_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1::CreateSecretRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["secret_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1::Secret), request["secret"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_secret_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.create_secret({ parent: parent, secret_id: secret_id, secret: secret }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.create_secret parent: parent, secret_id: secret_id, secret: secret do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.create_secret ::Google::Cloud::SecretManager::V1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.create_secret({ parent: parent, secret_id: secret_id, secret: secret }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.create_secret(::Google::Cloud::SecretManager::V1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_secret_client_stub.call_rpc_count + end + end + + def test_add_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.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" + payload = {} + + add_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1::SecretPayload), request["payload"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_secret_version_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.add_secret_version({ parent: parent, payload: payload }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.add_secret_version parent: parent, payload: payload do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.add_secret_version ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new(parent: parent, payload: payload) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.add_secret_version({ parent: parent, payload: payload }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.add_secret_version(::Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new(parent: parent, payload: payload), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, add_secret_version_client_stub.call_rpc_count + end + end + + def test_get_secret + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::Secret.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_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1::GetSecretRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_secret_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_secret({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_secret name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_secret ::Google::Cloud::SecretManager::V1::GetSecretRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_secret({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_secret(::Google::Cloud::SecretManager::V1::GetSecretRequest.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_secret_client_stub.call_rpc_count + end + end + + def test_update_secret + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::Secret.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. + secret = {} + update_mask = {} + + update_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1::UpdateSecretRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1::Secret), request["secret"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_secret_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.update_secret({ secret: secret, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.update_secret secret: secret, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.update_secret ::Google::Cloud::SecretManager::V1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.update_secret({ secret: secret, 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 + c.update_secret(::Google::Cloud::SecretManager::V1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_secret_client_stub.call_rpc_count + end + end + + def test_delete_secret + # 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" + etag = "hello world" + + delete_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1::DeleteSecretRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_secret_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.delete_secret({ name: name, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.delete_secret name: name, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.delete_secret ::Google::Cloud::SecretManager::V1::DeleteSecretRequest.new(name: name, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.delete_secret({ name: name, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.delete_secret(::Google::Cloud::SecretManager::V1::DeleteSecretRequest.new(name: name, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_secret_client_stub.call_rpc_count + end + end + + def test_list_secret_versions + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse.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" + filter = "hello world" + + list_secret_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_secret_versions, name + assert_kind_of ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest, 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["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_secret_versions_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.list_secret_versions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.list_secret_versions ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) 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 + c.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, 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 + c.list_secret_versions(::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), 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_secret_versions_client_stub.call_rpc_count + end + end + + def test_get_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.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_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_secret_version_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_secret_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_secret_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.get_secret_version ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.get_secret_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.get_secret_version(::Google::Cloud::SecretManager::V1::GetSecretVersionRequest.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_secret_version_client_stub.call_rpc_count + end + end + + def test_access_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse.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" + + access_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :access_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, access_secret_version_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.access_secret_version({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.access_secret_version name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.access_secret_version ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.access_secret_version({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.access_secret_version(::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.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, access_secret_version_client_stub.call_rpc_count + end + end + + def test_disable_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.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" + etag = "hello world" + + disable_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :disable_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, disable_secret_version_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.disable_secret_version({ name: name, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.disable_secret_version name: name, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.disable_secret_version ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new(name: name, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.disable_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.disable_secret_version(::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, disable_secret_version_client_stub.call_rpc_count + end + end + + def test_enable_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.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" + etag = "hello world" + + enable_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :enable_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, enable_secret_version_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.enable_secret_version({ name: name, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.enable_secret_version name: name, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.enable_secret_version ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new(name: name, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.enable_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.enable_secret_version(::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, enable_secret_version_client_stub.call_rpc_count + end + end + + def test_destroy_secret_version + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.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" + etag = "hello world" + + destroy_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :destroy_secret_version, name + assert_kind_of ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, destroy_secret_version_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.destroy_secret_version({ name: name, etag: etag }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.destroy_secret_version name: name, etag: etag do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.destroy_secret_version ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new(name: name, etag: etag) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.destroy_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.destroy_secret_version(::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, destroy_secret_version_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 + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.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 + c.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 + c.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 + c.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 + c.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 + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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 + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.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 + c.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 + c.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_enable_managed_rotation + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.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" + cloud_sql_single_user_credentials = {} + + enable_managed_rotation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :enable_managed_rotation, name + assert_kind_of ::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest::CloudSQLSingleUserCredentials), request["cloud_sql_single_user_credentials"] + assert_equal :cloud_sql_single_user_credentials, request.credentials + refute_nil options + end + + Gapic::ServiceStub.stub :new, enable_managed_rotation_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.enable_managed_rotation({ parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.enable_managed_rotation parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.enable_managed_rotation ::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new(parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.enable_managed_rotation({ parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.enable_managed_rotation(::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new(parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, enable_managed_rotation_client_stub.call_rpc_count + end + end + + def test_rotate_secret + # Create GRPC objects. + grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.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" + + rotate_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :rotate_secret, name + assert_kind_of ::Google::Cloud::SecretManager::V1::RotateSecretRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, rotate_secret_client_stub do + # Create client + c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + c.rotate_secret({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + c.rotate_secret parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + c.rotate_secret ::Google::Cloud::SecretManager::V1::RotateSecretRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + c.rotate_secret({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + c.rotate_secret(::Google::Cloud::SecretManager::V1::RotateSecretRequest.new(parent: parent), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, rotate_secret_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::SecretManager::V1::SecretManagerService::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::SecretManager::V1::SecretManagerService::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::SecretManager::V1::SecretManagerService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::SecretManager::V1::SecretManagerService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb b/owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "minitest/autorun" +require "minitest/focus" +require "minitest/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" From e918e95b1f3fad38251790efd92bc57cd1d2a9ed Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Mon, 13 Jul 2026 12:00:32 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- .../.owlbot-manifest.json | 5 + .../gapic_metadata.json | 10 + .../v1/secret_manager_service/client.rb | 198 ++ .../v1/secret_manager_service/rest/client.rb | 184 ++ .../rest/service_stub.rb | 140 ++ .../cloud/secretmanager/v1/resources_pb.rb | 7 +- .../cloud/secretmanager/v1/service_pb.rb | 5 +- .../secretmanager/v1/service_services_pb.rb | 10 + .../cloud/secretmanager/v1/resources.rb | 70 + .../google/cloud/secretmanager/v1/service.rb | 46 + .../google/iam/v1/resource_policy_member.rb | 0 .../proto_docs/google/protobuf/any.rb | 0 .../proto_docs/google/rpc/status.rb | 0 .../enable_managed_rotation.rb | 0 .../secret_manager_service/rotate_secret.rb | 0 ...etadata_google.cloud.secretmanager.v1.json | 80 + .../v1/secret_manager_service_rest_test.rb | 109 + .../v1/secret_manager_service_test.rb | 119 + .../google-cloud-secret_manager-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../google-cloud-secret_manager-v1/.toys.rb | 28 - .../google-cloud-secret_manager-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-secret_manager-v1/Gemfile | 14 - .../google-cloud-secret_manager-v1/LICENSE.md | 201 -- .../google-cloud-secret_manager-v1/README.md | 154 -- .../google-cloud-secret_manager-v1/Rakefile | 169 -- .../gapic_metadata.json | 103 - .../google-cloud-secret_manager-v1.gemspec | 30 - .../lib/google-cloud-secret_manager-v1.rb | 21 - .../lib/google/cloud/secret_manager/v1.rb | 45 - .../secret_manager/v1/bindings_override.rb | 75 - .../google/cloud/secret_manager/v1/rest.rb | 38 - .../v1/secret_manager_service.rb | 61 - .../v1/secret_manager_service/client.rb | 2189 ----------------- .../v1/secret_manager_service/credentials.rb | 51 - .../v1/secret_manager_service/paths.rb | 167 -- .../v1/secret_manager_service/rest.rb | 59 - .../v1/secret_manager_service/rest/client.rb | 2035 --------------- .../rest/service_stub.rb | 1257 ---------- .../google/cloud/secret_manager/v1/version.rb | 28 - .../cloud/secretmanager/v1/resources_pb.rb | 46 - .../cloud/secretmanager/v1/service_pb.rb | 48 - .../secretmanager/v1/service_services_pb.rb | 128 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 ----- .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 -- .../cloud/secretmanager/v1/resources.rb | 596 ----- .../google/cloud/secretmanager/v1/service.rb | 366 --- .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 ---- .../proto_docs/google/protobuf/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/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../access_secret_version.rb | 47 - .../add_secret_version.rb | 47 - .../secret_manager_service/create_secret.rb | 47 - .../secret_manager_service/delete_secret.rb | 47 - .../destroy_secret_version.rb | 47 - .../disable_secret_version.rb | 47 - .../enable_secret_version.rb | 47 - .../secret_manager_service/get_iam_policy.rb | 47 - .../secret_manager_service/get_secret.rb | 47 - .../get_secret_version.rb | 47 - .../list_secret_versions.rb | 51 - .../secret_manager_service/list_secrets.rb | 51 - .../secret_manager_service/set_iam_policy.rb | 47 - .../test_iam_permissions.rb | 47 - .../secret_manager_service/update_secret.rb | 47 - ...etadata_google.cloud.secretmanager.v1.json | 695 ------ .../v1/secret_manager_service_paths_test.rb | 109 - .../v1/secret_manager_service_rest_test.rb | 1036 -------- .../v1/secret_manager_service_test.rb | 1139 --------- .../test/helper.rb | 26 - 82 files changed, 981 insertions(+), 13976 deletions(-) rename {owl-bot-staging/google-cloud-secret_manager-v1 => google-cloud-secret_manager-v1}/proto_docs/google/iam/v1/resource_policy_member.rb (100%) rename {owl-bot-staging/google-cloud-secret_manager-v1 => google-cloud-secret_manager-v1}/proto_docs/google/protobuf/any.rb (100%) rename {owl-bot-staging/google-cloud-secret_manager-v1 => google-cloud-secret_manager-v1}/proto_docs/google/rpc/status.rb (100%) rename {owl-bot-staging/google-cloud-secret_manager-v1 => google-cloud-secret_manager-v1}/snippets/secret_manager_service/enable_managed_rotation.rb (100%) rename {owl-bot-staging/google-cloud-secret_manager-v1 => google-cloud-secret_manager-v1}/snippets/secret_manager_service/rotate_secret.rb (100%) delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/google-cloud-secret_manager-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google-cloud-secret_manager-v1.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/resources.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/service.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb diff --git a/google-cloud-secret_manager-v1/.owlbot-manifest.json b/google-cloud-secret_manager-v1/.owlbot-manifest.json index d57ef16a6f6d..93f6a50b87a1 100644 --- a/google-cloud-secret_manager-v1/.owlbot-manifest.json +++ b/google-cloud-secret_manager-v1/.owlbot-manifest.json @@ -38,10 +38,13 @@ "proto_docs/google/iam/v1/iam_policy.rb", "proto_docs/google/iam/v1/options.rb", "proto_docs/google/iam/v1/policy.rb", + "proto_docs/google/iam/v1/resource_policy_member.rb", + "proto_docs/google/protobuf/any.rb", "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", + "proto_docs/google/rpc/status.rb", "proto_docs/google/type/expr.rb", "snippets/Gemfile", "snippets/secret_manager_service/access_secret_version.rb", @@ -50,12 +53,14 @@ "snippets/secret_manager_service/delete_secret.rb", "snippets/secret_manager_service/destroy_secret_version.rb", "snippets/secret_manager_service/disable_secret_version.rb", + "snippets/secret_manager_service/enable_managed_rotation.rb", "snippets/secret_manager_service/enable_secret_version.rb", "snippets/secret_manager_service/get_iam_policy.rb", "snippets/secret_manager_service/get_secret.rb", "snippets/secret_manager_service/get_secret_version.rb", "snippets/secret_manager_service/list_secret_versions.rb", "snippets/secret_manager_service/list_secrets.rb", + "snippets/secret_manager_service/rotate_secret.rb", "snippets/secret_manager_service/set_iam_policy.rb", "snippets/secret_manager_service/test_iam_permissions.rb", "snippets/secret_manager_service/update_secret.rb", diff --git a/google-cloud-secret_manager-v1/gapic_metadata.json b/google-cloud-secret_manager-v1/gapic_metadata.json index 195f6c899ecf..3964d548b435 100644 --- a/google-cloud-secret_manager-v1/gapic_metadata.json +++ b/google-cloud-secret_manager-v1/gapic_metadata.json @@ -84,6 +84,16 @@ "methods": [ "test_iam_permissions" ] + }, + "EnableManagedRotation": { + "methods": [ + "enable_managed_rotation" + ] + }, + "RotateSecret": { + "methods": [ + "rotate_secret" + ] } } } diff --git a/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb b/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb index bc2a1e0b921c..fe199e95e549 100644 --- a/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb +++ b/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb @@ -1685,6 +1685,190 @@ def test_iam_permissions request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Enables the managed rotation feature for a + # {::Google::Cloud::SecretManager::V1::Secret Secret}. This method can only be + # triggered once for a secret. In order to do further rotations, RotateSecret + # should be used. This method will add a secret version and update the + # password in Cloud SQL. + # + # @overload enable_managed_rotation(request, options = nil) + # Pass arguments to `enable_managed_rotation` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest, ::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 enable_managed_rotation(parent: nil, cloud_sql_single_user_credentials: nil) + # Pass arguments to `enable_managed_rotation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @param cloud_sql_single_user_credentials [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest::CloudSQLSingleUserCredentials, ::Hash] + # Credentials required for Cloud SQL DB for Single user Managed Rotation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new + # + # # Call the enable_managed_rotation method. + # result = client.enable_managed_rotation request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def enable_managed_rotation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest + + # 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.enable_managed_rotation.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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.enable_managed_rotation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.enable_managed_rotation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :enable_managed_rotation, 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 + + ## + # Do a managed rotation for a {::Google::Cloud::SecretManager::V1::Secret Secret}. + # This can only be triggered after Managed rotation has been enabled. + # This method will add a secret version and update the password in Cloud SQL. + # + # @overload rotate_secret(request, options = nil) + # Pass arguments to `rotate_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::RotateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::RotateSecretRequest, ::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 rotate_secret(parent: nil) + # Pass arguments to `rotate_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::RotateSecretRequest.new + # + # # Call the rotate_secret method. + # result = client.rotate_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def rotate_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::RotateSecretRequest + + # 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.rotate_secret.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::SecretManager::V1::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.rotate_secret.timeout, + metadata: metadata, + retry_policy: @config.rpcs.rotate_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.call_rpc :rotate_secret, 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 SecretManagerService API. # @@ -1945,6 +2129,16 @@ class Rpcs # @return [::Gapic::Config::Method] # attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `enable_managed_rotation` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_managed_rotation + ## + # RPC-specific configuration for `rotate_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :rotate_secret # @private def initialize parent_rpcs = nil @@ -1978,6 +2172,10 @@ def initialize parent_rpcs = nil @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 + enable_managed_rotation_config = parent_rpcs.enable_managed_rotation if parent_rpcs.respond_to? :enable_managed_rotation + @enable_managed_rotation = ::Gapic::Config::Method.new enable_managed_rotation_config + rotate_secret_config = parent_rpcs.rotate_secret if parent_rpcs.respond_to? :rotate_secret + @rotate_secret = ::Gapic::Config::Method.new rotate_secret_config yield self if block_given? end diff --git a/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb b/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb index 81caa928f014..3c92e26a238b 100644 --- a/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb +++ b/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb @@ -1574,6 +1574,176 @@ def test_iam_permissions request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Enables the managed rotation feature for a + # {::Google::Cloud::SecretManager::V1::Secret Secret}. This method can only be + # triggered once for a secret. In order to do further rotations, RotateSecret + # should be used. This method will add a secret version and update the + # password in Cloud SQL. + # + # @overload enable_managed_rotation(request, options = nil) + # Pass arguments to `enable_managed_rotation` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest, ::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 enable_managed_rotation(parent: nil, cloud_sql_single_user_credentials: nil) + # Pass arguments to `enable_managed_rotation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @param cloud_sql_single_user_credentials [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest::CloudSQLSingleUserCredentials, ::Hash] + # Credentials required for Cloud SQL DB for Single user Managed Rotation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new + # + # # Call the enable_managed_rotation method. + # result = client.enable_managed_rotation request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def enable_managed_rotation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest + + # 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.enable_managed_rotation.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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.enable_managed_rotation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.enable_managed_rotation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.enable_managed_rotation 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 + + ## + # Do a managed rotation for a {::Google::Cloud::SecretManager::V1::Secret Secret}. + # This can only be triggered after Managed rotation has been enabled. + # This method will add a secret version and update the password in Cloud SQL. + # + # @overload rotate_secret(request, options = nil) + # Pass arguments to `rotate_secret` via a request object, either of type + # {::Google::Cloud::SecretManager::V1::RotateSecretRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::SecretManager::V1::RotateSecretRequest, ::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 rotate_secret(parent: nil) + # Pass arguments to `rotate_secret` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the + # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the + # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format + # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/secret_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::SecretManager::V1::RotateSecretRequest.new + # + # # Call the rotate_secret method. + # result = client.rotate_secret request + # + # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + # p result + # + def rotate_secret request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::RotateSecretRequest + + # 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.rotate_secret.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::SecretManager::V1::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.rotate_secret.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.rotate_secret.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @secret_manager_service_stub.rotate_secret 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 SecretManagerService REST API. # @@ -1804,6 +1974,16 @@ class Rpcs # @return [::Gapic::Config::Method] # attr_reader :test_iam_permissions + ## + # RPC-specific configuration for `enable_managed_rotation` + # @return [::Gapic::Config::Method] + # + attr_reader :enable_managed_rotation + ## + # RPC-specific configuration for `rotate_secret` + # @return [::Gapic::Config::Method] + # + attr_reader :rotate_secret # @private def initialize parent_rpcs = nil @@ -1837,6 +2017,10 @@ def initialize parent_rpcs = nil @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 + enable_managed_rotation_config = parent_rpcs.enable_managed_rotation if parent_rpcs.respond_to? :enable_managed_rotation + @enable_managed_rotation = ::Gapic::Config::Method.new enable_managed_rotation_config + rotate_secret_config = parent_rpcs.rotate_secret if parent_rpcs.respond_to? :rotate_secret + @rotate_secret = ::Gapic::Config::Method.new rotate_secret_config yield self if block_given? end diff --git a/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb b/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb index b08fe1c5887b..6a2afc299d8b 100644 --- a/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb +++ b/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb @@ -673,6 +673,86 @@ def test_iam_permissions request_pb, options = nil end end + ## + # Baseline implementation for the enable_managed_rotation REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest] + # 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::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # A result object deserialized from the server's reply + def enable_managed_rotation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_enable_managed_rotation_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: "enable_managed_rotation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the rotate_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::RotateSecretRequest] + # 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::SecretManager::V1::SecretVersion] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::SecretManager::V1::SecretVersion] + # A result object deserialized from the server's reply + def rotate_secret request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_rotate_secret_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: "rotate_secret", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + ## # @private # @@ -1108,6 +1188,66 @@ def self.transcode_test_iam_permissions_request request_pb ) transcoder.transcode request_pb end + + ## + # @private + # + # GRPC transcoding helper method for the enable_managed_rotation REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_enable_managed_rotation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:enableManagedRotation", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:enableManagedRotation", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the rotate_secret REST call + # + # @param request_pb [::Google::Cloud::SecretManager::V1::RotateSecretRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_rotate_secret_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:rotateSecret", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:rotateSecret", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end end end end diff --git a/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb b/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb index 6864a9474c87..c7770a98e7bb 100644 --- a/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb +++ b/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb @@ -6,11 +6,13 @@ require 'google/api/field_behavior_pb' require 'google/api/resource_pb' +require 'google/iam/v1/resource_policy_member_pb' require 'google/protobuf/duration_pb' require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' -descriptor_data = "\n-google/cloud/secretmanager/v1/resources.proto\x12\x1dgoogle.cloud.secretmanager.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd9\t\n\x06Secret\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12G\n\x0breplication\x18\x02 \x01(\x0b\x32*.google.cloud.secretmanager.v1.ReplicationB\x06\xe0\x41\x05\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x06labels\x18\x04 \x03(\x0b\x32\x31.google.cloud.secretmanager.v1.Secret.LabelsEntry\x12\x39\n\x06topics\x18\x05 \x03(\x0b\x32$.google.cloud.secretmanager.v1.TopicB\x03\xe0\x41\x01\x12\x36\n\x0b\x65xpire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x00\x12-\n\x03ttl\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04H\x00\x12\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12>\n\x08rotation\x18\t \x01(\x0b\x32\'.google.cloud.secretmanager.v1.RotationB\x03\xe0\x41\x01\x12W\n\x0fversion_aliases\x18\x0b \x03(\x0b\x32\x39.google.cloud.secretmanager.v1.Secret.VersionAliasesEntryB\x03\xe0\x41\x01\x12P\n\x0b\x61nnotations\x18\r \x03(\x0b\x32\x36.google.cloud.secretmanager.v1.Secret.AnnotationsEntryB\x03\xe0\x41\x01\x12;\n\x13version_destroy_ttl\x18\x0e \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x0f \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x12H\n\x04tags\x18\x10 \x03(\x0b\x32/.google.cloud.secretmanager.v1.Secret.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x35\n\x13VersionAliasesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\x99\x01\xea\x41\x95\x01\n#secretmanager.googleapis.com/Secret\x12#projects/{project}/secrets/{secret}\x12\x38projects/{project}/locations/{location}/secrets/{secret}*\x07secrets2\x06secretB\x0c\n\nexpiration\"\xc2\x06\n\rSecretVersion\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0c\x64\x65stroy_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x46\n\x05state\x18\x04 \x01(\x0e\x32\x32.google.cloud.secretmanager.v1.SecretVersion.StateB\x03\xe0\x41\x03\x12L\n\x12replication_status\x18\x05 \x01(\x0b\x32\x30.google.cloud.secretmanager.v1.ReplicationStatus\x12\x11\n\x04\x65tag\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12.\n!client_specified_payload_checksum\x18\x07 \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x16scheduled_destroy_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12h\n\x1b\x63ustomer_managed_encryption\x18\t \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\"H\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tDESTROYED\x10\x03:\xe2\x01\xea\x41\xde\x01\n*secretmanager.googleapis.com/SecretVersion\x12=projects/{project}/secrets/{secret}/versions/{secret_version}\x12Rprojects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}*\x0esecretVersions2\rsecretVersion\"\x90\x04\n\x0bReplication\x12I\n\tautomatic\x18\x01 \x01(\x0b\x32\x34.google.cloud.secretmanager.v1.Replication.AutomaticH\x00\x12N\n\x0cuser_managed\x18\x02 \x01(\x0b\x32\x36.google.cloud.secretmanager.v1.Replication.UserManagedH\x00\x1ao\n\tAutomatic\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x01 \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x1a\xe5\x01\n\x0bUserManaged\x12U\n\x08replicas\x18\x01 \x03(\x0b\x32>.google.cloud.secretmanager.v1.Replication.UserManaged.ReplicaB\x03\xe0\x41\x02\x1a\x7f\n\x07Replica\x12\x10\n\x08location\x18\x01 \x01(\t\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x02 \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x42\r\n\x0breplication\"6\n\x19\x43ustomerManagedEncryption\x12\x19\n\x0ckms_key_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xeb\x04\n\x11ReplicationStatus\x12U\n\tautomatic\x18\x01 \x01(\x0b\x32@.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatusH\x00\x12Z\n\x0cuser_managed\x18\x02 \x01(\x0b\x32\x42.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatusH\x00\x1a{\n\x0f\x41utomaticStatus\x12h\n\x1b\x63ustomer_managed_encryption\x18\x01 \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\x1a\x8f\x02\n\x11UserManagedStatus\x12g\n\x08replicas\x18\x01 \x03(\x0b\x32P.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatusB\x03\xe0\x41\x03\x1a\x90\x01\n\rReplicaStatus\x12\x15\n\x08location\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12h\n\x1b\x63ustomer_managed_encryption\x18\x02 \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\x42\x14\n\x12replication_status\"D\n\x1f\x43ustomerManagedEncryptionStatus\x12!\n\x14kms_key_version_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"_\n\x05Topic\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08:C\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}\"\x80\x01\n\x08Rotation\x12;\n\x12next_rotation_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12\x37\n\x0frotation_period\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04\"L\n\rSecretPayload\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\x1d\n\x0b\x64\x61ta_crc32c\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x0e\n\x0c_data_crc32cB\xe7\x01\n!com.google.cloud.secretmanager.v1B\x0eResourcesProtoP\x01ZGcloud.google.com/go/secretmanager/apiv1/secretmanagerpb;secretmanagerpb\xa2\x02\x03GSM\xaa\x02\x1dGoogle.Cloud.SecretManager.V1\xca\x02\x1dGoogle\\Cloud\\SecretManager\\V1\xea\x02 Google::Cloud::SecretManager::V1b\x06proto3" +descriptor_data = "\n-google/cloud/secretmanager/v1/resources.proto\x12\x1dgoogle.cloud.secretmanager.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/iam/v1/resource_policy_member.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xf9\x0b\n\x06Secret\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12G\n\x0breplication\x18\x02 \x01(\x0b\x32*.google.cloud.secretmanager.v1.ReplicationB\x06\xe0\x41\x05\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x06labels\x18\x04 \x03(\x0b\x32\x31.google.cloud.secretmanager.v1.Secret.LabelsEntry\x12\x39\n\x06topics\x18\x05 \x03(\x0b\x32$.google.cloud.secretmanager.v1.TopicB\x03\xe0\x41\x01\x12\x36\n\x0b\x65xpire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x00\x12-\n\x03ttl\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04H\x00\x12\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12>\n\x08rotation\x18\t \x01(\x0b\x32\'.google.cloud.secretmanager.v1.RotationB\x03\xe0\x41\x01\x12W\n\x0fversion_aliases\x18\x0b \x03(\x0b\x32\x39.google.cloud.secretmanager.v1.Secret.VersionAliasesEntryB\x03\xe0\x41\x01\x12P\n\x0b\x61nnotations\x18\r \x03(\x0b\x32\x36.google.cloud.secretmanager.v1.Secret.AnnotationsEntryB\x03\xe0\x41\x01\x12;\n\x13version_destroy_ttl\x18\x0e \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x0f \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x12H\n\x04tags\x18\x10 \x03(\x0b\x32/.google.cloud.secretmanager.v1.Secret.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x12M\n\x0bsecret_type\x18\x11 \x01(\x0e\x32\x30.google.cloud.secretmanager.v1.Secret.SecretTypeB\x06\xe0\x41\x05\xe0\x41\x01\x12?\n\rpolicy_member\x18\x12 \x01(\x0b\x32#.google.iam.v1.ResourcePolicyMemberB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x35\n\x13VersionAliasesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8d\x01\n\nSecretType\x12\x1b\n\x17SECRET_TYPE_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x43LOUD_SQL_DB_CREDENTIALS\x10\x01\x12\x0e\n\nACCESS_KEY\x10\x02\x12\x0f\n\x0b\x43\x45RTIFICATE\x10\x03\x12\x18\n\x14OTHER_DB_CREDENTIALS\x10\x04\x12\t\n\x05OTHER\x10\x32:\x99\x01\xea\x41\x95\x01\n#secretmanager.googleapis.com/Secret\x12#projects/{project}/secrets/{secret}\x12\x38projects/{project}/locations/{location}/secrets/{secret}*\x07secrets2\x06secretB\x0c\n\nexpiration\"\xc2\x06\n\rSecretVersion\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0c\x64\x65stroy_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x46\n\x05state\x18\x04 \x01(\x0e\x32\x32.google.cloud.secretmanager.v1.SecretVersion.StateB\x03\xe0\x41\x03\x12L\n\x12replication_status\x18\x05 \x01(\x0b\x32\x30.google.cloud.secretmanager.v1.ReplicationStatus\x12\x11\n\x04\x65tag\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12.\n!client_specified_payload_checksum\x18\x07 \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x16scheduled_destroy_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12h\n\x1b\x63ustomer_managed_encryption\x18\t \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\"H\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tDESTROYED\x10\x03:\xe2\x01\xea\x41\xde\x01\n*secretmanager.googleapis.com/SecretVersion\x12=projects/{project}/secrets/{secret}/versions/{secret_version}\x12Rprojects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}*\x0esecretVersions2\rsecretVersion\"\x90\x04\n\x0bReplication\x12I\n\tautomatic\x18\x01 \x01(\x0b\x32\x34.google.cloud.secretmanager.v1.Replication.AutomaticH\x00\x12N\n\x0cuser_managed\x18\x02 \x01(\x0b\x32\x36.google.cloud.secretmanager.v1.Replication.UserManagedH\x00\x1ao\n\tAutomatic\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x01 \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x1a\xe5\x01\n\x0bUserManaged\x12U\n\x08replicas\x18\x01 \x03(\x0b\x32>.google.cloud.secretmanager.v1.Replication.UserManaged.ReplicaB\x03\xe0\x41\x02\x1a\x7f\n\x07Replica\x12\x10\n\x08location\x18\x01 \x01(\t\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x02 \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x42\r\n\x0breplication\"6\n\x19\x43ustomerManagedEncryption\x12\x19\n\x0ckms_key_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xeb\x04\n\x11ReplicationStatus\x12U\n\tautomatic\x18\x01 \x01(\x0b\x32@.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatusH\x00\x12Z\n\x0cuser_managed\x18\x02 \x01(\x0b\x32\x42.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatusH\x00\x1a{\n\x0f\x41utomaticStatus\x12h\n\x1b\x63ustomer_managed_encryption\x18\x01 \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\x1a\x8f\x02\n\x11UserManagedStatus\x12g\n\x08replicas\x18\x01 \x03(\x0b\x32P.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatusB\x03\xe0\x41\x03\x1a\x90\x01\n\rReplicaStatus\x12\x15\n\x08location\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12h\n\x1b\x63ustomer_managed_encryption\x18\x02 \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\x42\x14\n\x12replication_status\"D\n\x1f\x43ustomerManagedEncryptionStatus\x12!\n\x14kms_key_version_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"_\n\x05Topic\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08:C\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}\"\xba\x03\n\x08Rotation\x12;\n\x12next_rotation_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12\x37\n\x0frotation_period\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04\x12\x63\n\x17managed_rotation_status\x18\x03 \x01(\x0b\x32=.google.cloud.secretmanager.v1.Rotation.ManagedRotationStatusB\x03\xe0\x41\x03\x1a\xd2\x01\n\x15ManagedRotationStatus\x12W\n\x05state\x18\x01 \x01(\x0e\x32\x43.google.cloud.secretmanager.v1.Rotation.ManagedRotationStatus.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08INACTIVE\x10\x02\"L\n\rSecretPayload\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\x1d\n\x0b\x64\x61ta_crc32c\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x0e\n\x0c_data_crc32cB\xe7\x01\n!com.google.cloud.secretmanager.v1B\x0eResourcesProtoP\x01ZGcloud.google.com/go/secretmanager/apiv1/secretmanagerpb;secretmanagerpb\xa2\x02\x03GSM\xaa\x02\x1dGoogle.Cloud.SecretManager.V1\xca\x02\x1dGoogle\\Cloud\\SecretManager\\V1\xea\x02 Google::Cloud::SecretManager::V1b\x06proto3" pool = ::Google::Protobuf::DescriptorPool.generated_pool pool.add_serialized_file(descriptor_data) @@ -20,6 +22,7 @@ module Cloud module SecretManager module V1 Secret = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Secret").msgclass + Secret::SecretType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Secret.SecretType").enummodule SecretVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.SecretVersion").msgclass SecretVersion::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.SecretVersion.State").enummodule Replication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication").msgclass @@ -34,6 +37,8 @@ module V1 CustomerManagedEncryptionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus").msgclass Topic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Topic").msgclass Rotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Rotation").msgclass + Rotation::ManagedRotationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Rotation.ManagedRotationStatus").msgclass + Rotation::ManagedRotationStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Rotation.ManagedRotationStatus.State").enummodule SecretPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.SecretPayload").msgclass end end diff --git a/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb b/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb index 347d6e922756..66de23a46f13 100644 --- a/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb +++ b/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb @@ -15,7 +15,7 @@ require 'google/protobuf/field_mask_pb' -descriptor_data = "\n+google/cloud/secretmanager/v1/service.proto\x12\x1dgoogle.cloud.secretmanager.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/secretmanager/v1/resources.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x97\x01\n\x12ListSecretsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#secretmanager.googleapis.com/Secret\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\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"z\n\x13ListSecretsResponse\x12\x36\n\x07secrets\x18\x01 \x03(\x0b\x32%.google.cloud.secretmanager.v1.Secret\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\xa6\x01\n\x13\x43reateSecretRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#secretmanager.googleapis.com/Secret\x12\x16\n\tsecret_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\x06secret\x18\x03 \x01(\x0b\x32%.google.cloud.secretmanager.v1.SecretB\x03\xe0\x41\x02\"\x9a\x01\n\x17\x41\x64\x64SecretVersionRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x42\n\x07payload\x18\x02 \x01(\x0b\x32,.google.cloud.secretmanager.v1.SecretPayloadB\x03\xe0\x41\x02\"M\n\x10GetSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\"\x9e\x01\n\x19ListSecretVersionsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\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\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x89\x01\n\x1aListSecretVersionsResponse\x12>\n\x08versions\x18\x01 \x03(\x0b\x32,.google.cloud.secretmanager.v1.SecretVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"[\n\x17GetSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x87\x01\n\x13UpdateSecretRequest\x12:\n\x06secret\x18\x01 \x01(\x0b\x32%.google.cloud.secretmanager.v1.SecretB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"^\n\x1a\x41\x63\x63\x65ssSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x9b\x01\n\x1b\x41\x63\x63\x65ssSecretVersionResponse\x12=\n\x04name\x18\x01 \x01(\tB/\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12=\n\x07payload\x18\x02 \x01(\x0b\x32,.google.cloud.secretmanager.v1.SecretPayload\"c\n\x13\x44\x65leteSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"r\n\x1b\x44isableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"q\n\x1a\x45nableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"r\n\x1b\x44\x65stroySecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x32\xe8\x1c\n\x14SecretManagerService\x12\xd5\x01\n\x0bListSecrets\x12\x31.google.cloud.secretmanager.v1.ListSecretsRequest\x1a\x32.google.cloud.secretmanager.v1.ListSecretsResponse\"_\xda\x41\x06parent\x82\xd3\xe4\x93\x02P\x12\x1f/v1/{parent=projects/*}/secretsZ-\x12+/v1/{parent=projects/*/locations/*}/secrets\x12\xec\x01\n\x0c\x43reateSecret\x12\x32.google.cloud.secretmanager.v1.CreateSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"\x80\x01\xda\x41\x17parent,secret_id,secret\x82\xd3\xe4\x93\x02`\"\x1f/v1/{parent=projects/*}/secrets:\x06secretZ5\"+/v1/{parent=projects/*/locations/*}/secrets:\x06secret\x12\x82\x02\n\x10\x41\x64\x64SecretVersion\x12\x36.google.cloud.secretmanager.v1.AddSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x87\x01\xda\x41\x0eparent,payload\x82\xd3\xe4\x93\x02p\",/v1/{parent=projects/*/secrets/*}:addVersion:\x01*Z=\"8/v1/{parent=projects/*/locations/*/secrets/*}:addVersion:\x01*\x12\xc2\x01\n\tGetSecret\x12/.google.cloud.secretmanager.v1.GetSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"]\xda\x41\x04name\x82\xd3\xe4\x93\x02P\x12\x1f/v1/{name=projects/*/secrets/*}Z-\x12+/v1/{name=projects/*/locations/*/secrets/*}\x12\xf5\x01\n\x0cUpdateSecret\x12\x32.google.cloud.secretmanager.v1.UpdateSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"\x89\x01\xda\x41\x12secret,update_mask\x82\xd3\xe4\x93\x02n2&/v1/{secret.name=projects/*/secrets/*}:\x06secretZ<22/v1/{secret.name=projects/*/locations/*/secrets/*}:\x06secret\x12\xb9\x01\n\x0c\x44\x65leteSecret\x12\x32.google.cloud.secretmanager.v1.DeleteSecretRequest\x1a\x16.google.protobuf.Empty\"]\xda\x41\x04name\x82\xd3\xe4\x93\x02P*\x1f/v1/{name=projects/*/secrets/*}Z-*+/v1/{name=projects/*/locations/*/secrets/*}\x12\x80\x02\n\x12ListSecretVersions\x12\x38.google.cloud.secretmanager.v1.ListSecretVersionsRequest\x1a\x39.google.cloud.secretmanager.v1.ListSecretVersionsResponse\"u\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x66\x12*/v1/{parent=projects/*/secrets/*}/versionsZ8\x12\x36/v1/{parent=projects/*/locations/*/secrets/*}/versions\x12\xed\x01\n\x10GetSecretVersion\x12\x36.google.cloud.secretmanager.v1.GetSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"s\xda\x41\x04name\x82\xd3\xe4\x93\x02\x66\x12*/v1/{name=projects/*/secrets/*/versions/*}Z8\x12\x36/v1/{name=projects/*/locations/*/secrets/*/versions/*}\x12\x90\x02\n\x13\x41\x63\x63\x65ssSecretVersion\x12\x39.google.cloud.secretmanager.v1.AccessSecretVersionRequest\x1a:.google.cloud.secretmanager.v1.AccessSecretVersionResponse\"\x81\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02t\x12\x31/v1/{name=projects/*/secrets/*/versions/*}:accessZ?\x12=/v1/{name=projects/*/locations/*/secrets/*/versions/*}:access\x12\x8c\x02\n\x14\x44isableSecretVersion\x12:.google.cloud.secretmanager.v1.DisableSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x89\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02|\"2/v1/{name=projects/*/secrets/*/versions/*}:disable:\x01*ZC\">/v1/{name=projects/*/locations/*/secrets/*/versions/*}:disable:\x01*\x12\x88\x02\n\x13\x45nableSecretVersion\x12\x39.google.cloud.secretmanager.v1.EnableSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x87\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02z\"1/v1/{name=projects/*/secrets/*/versions/*}:enable:\x01*ZB\"=/v1/{name=projects/*/locations/*/secrets/*/versions/*}:enable:\x01*\x12\x8c\x02\n\x14\x44\x65stroySecretVersion\x12:.google.cloud.secretmanager.v1.DestroySecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x89\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02|\"2/v1/{name=projects/*/secrets/*/versions/*}:destroy:\x01*ZC\">/v1/{name=projects/*/locations/*/secrets/*/versions/*}:destroy:\x01*\x12\xc9\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"~\x82\xd3\xe4\x93\x02x\"0/v1/{resource=projects/*/secrets/*}:setIamPolicy:\x01*ZA\"\x12\n\x08versions\x18\x01 \x03(\x0b\x32,.google.cloud.secretmanager.v1.SecretVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"[\n\x17GetSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x87\x01\n\x13UpdateSecretRequest\x12:\n\x06secret\x18\x01 \x01(\x0b\x32%.google.cloud.secretmanager.v1.SecretB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"^\n\x1a\x41\x63\x63\x65ssSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x9b\x01\n\x1b\x41\x63\x63\x65ssSecretVersionResponse\x12=\n\x04name\x18\x01 \x01(\tB/\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12=\n\x07payload\x18\x02 \x01(\x0b\x32,.google.cloud.secretmanager.v1.SecretPayload\"c\n\x13\x44\x65leteSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"r\n\x1b\x44isableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"q\n\x1a\x45nableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"r\n\x1b\x44\x65stroySecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x32\xa1!\n\x14SecretManagerService\x12\xd5\x01\n\x0bListSecrets\x12\x31.google.cloud.secretmanager.v1.ListSecretsRequest\x1a\x32.google.cloud.secretmanager.v1.ListSecretsResponse\"_\xda\x41\x06parent\x82\xd3\xe4\x93\x02P\x12\x1f/v1/{parent=projects/*}/secretsZ-\x12+/v1/{parent=projects/*/locations/*}/secrets\x12\xec\x01\n\x0c\x43reateSecret\x12\x32.google.cloud.secretmanager.v1.CreateSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"\x80\x01\xda\x41\x17parent,secret_id,secret\x82\xd3\xe4\x93\x02`\"\x1f/v1/{parent=projects/*}/secrets:\x06secretZ5\"+/v1/{parent=projects/*/locations/*}/secrets:\x06secret\x12\x82\x02\n\x10\x41\x64\x64SecretVersion\x12\x36.google.cloud.secretmanager.v1.AddSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x87\x01\xda\x41\x0eparent,payload\x82\xd3\xe4\x93\x02p\",/v1/{parent=projects/*/secrets/*}:addVersion:\x01*Z=\"8/v1/{parent=projects/*/locations/*/secrets/*}:addVersion:\x01*\x12\xc2\x01\n\tGetSecret\x12/.google.cloud.secretmanager.v1.GetSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"]\xda\x41\x04name\x82\xd3\xe4\x93\x02P\x12\x1f/v1/{name=projects/*/secrets/*}Z-\x12+/v1/{name=projects/*/locations/*/secrets/*}\x12\xf5\x01\n\x0cUpdateSecret\x12\x32.google.cloud.secretmanager.v1.UpdateSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"\x89\x01\xda\x41\x12secret,update_mask\x82\xd3\xe4\x93\x02n2&/v1/{secret.name=projects/*/secrets/*}:\x06secretZ<22/v1/{secret.name=projects/*/locations/*/secrets/*}:\x06secret\x12\xb9\x01\n\x0c\x44\x65leteSecret\x12\x32.google.cloud.secretmanager.v1.DeleteSecretRequest\x1a\x16.google.protobuf.Empty\"]\xda\x41\x04name\x82\xd3\xe4\x93\x02P*\x1f/v1/{name=projects/*/secrets/*}Z-*+/v1/{name=projects/*/locations/*/secrets/*}\x12\x80\x02\n\x12ListSecretVersions\x12\x38.google.cloud.secretmanager.v1.ListSecretVersionsRequest\x1a\x39.google.cloud.secretmanager.v1.ListSecretVersionsResponse\"u\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x66\x12*/v1/{parent=projects/*/secrets/*}/versionsZ8\x12\x36/v1/{parent=projects/*/locations/*/secrets/*}/versions\x12\xed\x01\n\x10GetSecretVersion\x12\x36.google.cloud.secretmanager.v1.GetSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"s\xda\x41\x04name\x82\xd3\xe4\x93\x02\x66\x12*/v1/{name=projects/*/secrets/*/versions/*}Z8\x12\x36/v1/{name=projects/*/locations/*/secrets/*/versions/*}\x12\x90\x02\n\x13\x41\x63\x63\x65ssSecretVersion\x12\x39.google.cloud.secretmanager.v1.AccessSecretVersionRequest\x1a:.google.cloud.secretmanager.v1.AccessSecretVersionResponse\"\x81\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02t\x12\x31/v1/{name=projects/*/secrets/*/versions/*}:accessZ?\x12=/v1/{name=projects/*/locations/*/secrets/*/versions/*}:access\x12\x8c\x02\n\x14\x44isableSecretVersion\x12:.google.cloud.secretmanager.v1.DisableSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x89\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02|\"2/v1/{name=projects/*/secrets/*/versions/*}:disable:\x01*ZC\">/v1/{name=projects/*/locations/*/secrets/*/versions/*}:disable:\x01*\x12\x88\x02\n\x13\x45nableSecretVersion\x12\x39.google.cloud.secretmanager.v1.EnableSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x87\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02z\"1/v1/{name=projects/*/secrets/*/versions/*}:enable:\x01*ZB\"=/v1/{name=projects/*/locations/*/secrets/*/versions/*}:enable:\x01*\x12\x8c\x02\n\x14\x44\x65stroySecretVersion\x12:.google.cloud.secretmanager.v1.DestroySecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x89\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02|\"2/v1/{name=projects/*/secrets/*/versions/*}:destroy:\x01*ZC\">/v1/{name=projects/*/locations/*/secrets/*/versions/*}:destroy:\x01*\x12\xc9\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"~\x82\xd3\xe4\x93\x02x\"0/v1/{resource=projects/*/secrets/*}:setIamPolicy:\x01*ZA\"\x12= 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-secret_manager-v1/.yardopts b/owl-bot-staging/google-cloud-secret_manager-v1/.yardopts deleted file mode 100644 index 6a5817faa0dc..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Secret Manager V1 API" ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet - -./lib/**/*.rb -./proto_docs/**/*.rb -- -README.md -LICENSE.md -AUTHENTICATION.md diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-secret_manager-v1/AUTHENTICATION.md deleted file mode 100644 index 6ba9773b1dc0..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-secret_manager-v1 library is to use -[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials). -To review all of your authentication options, see [Credentials lookup](#credential-lookup). - -## Quickstart - -The following example shows how to set up authentication for a local development -environment with your user credentials. - -**NOTE:** This method is _not_ recommended for running in production. User credentials -should be used only during development. - -1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk). -2. Set up a local ADC file with your user credentials: - -```sh -gcloud auth application-default login -``` - -3. Write code as if already authenticated. - -For more information about setting up authentication for a local development environment, see -[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev). - -## Credential Lookup - -The google-cloud-secret_manager-v1 library provides several mechanisms to configure your system. -Generally, using Application Default Credentials to facilitate automatic -credentials discovery is the easist method. But if you need to explicitly specify -credentials, there are several methods available to you. - -Credentials are accepted in the following ways, in the following order or precedence: - -1. Credentials specified in method arguments -2. Credentials specified in configuration -3. Credentials pointed to or included in environment variables -4. Credentials found in local ADC file -5. Credentials returned by the metadata server for the attached service account (GCP) - -### Configuration - -You can configure a path to a JSON credentials file, either for an individual client object or -globally, for all client objects. The JSON file can contain credentials created for -[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation), -[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a -[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key). - -Note: Service account keys are a security risk if not managed correctly. You should -[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree) -whenever possible. - -To configure a credentials file for an individual client initialization: - -```ruby -require "google/cloud/secret_manager/v1" - -client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/secret_manager/v1" - -::Google::Cloud::SecretManager::V1::SecretManagerService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::SecretManager::V1::SecretManagerService::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-secret_manager-v1 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/secret_manager/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::SecretManager::V1::SecretManagerService::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-secret_manager-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-secret_manager-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/Gemfile b/owl-bot-staging/google-cloud-secret_manager-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/LICENSE.md b/owl-bot-staging/google-cloud-secret_manager-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/LICENSE.md +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/README.md b/owl-bot-staging/google-cloud-secret_manager-v1/README.md deleted file mode 100644 index 2313a9df45b2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Secret Manager V1 API - -Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security. - -Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Secret Manager V1 API. Most users should consider using -the main client gem, -[google-cloud-secret_manager](https://rubygems.org/gems/google-cloud-secret_manager). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-secret_manager-v1 -``` - -## Before You Begin - -In order to use this library, you first need to go through the following steps: - -1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) -1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) -1. [Enable the API.](https://console.cloud.google.com/apis/library/secretmanager.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/secret_manager/v1" - -client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -request = ::Google::Cloud::SecretManager::V1::ListSecretsRequest.new # (request fields as keyword arguments...) -response = client.list_secrets request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-secret_manager-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/secret-manager) -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/secret_manager/v1" -require "logger" - -client = ::Google::Cloud::SecretManager::V1::SecretManagerService::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.2+. - -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-secret_manager`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-secret_manager-v1`. -_In most cases, you should install the main client._ - -### What's the difference between the main client and a versioned client? - -A _versioned client_ provides a basic set of data types and client classes for -a _single version_ of a specific service. (That is, for a service with multiple -versions, there might be a separate versioned client for each service version.) -Most versioned clients are written and maintained by a code generator. - -The _main client_ is designed to provide you with the _recommended_ client -interfaces for the service. There will be only one main client for any given -service, even a service with multiple versions. The main client includes -factory methods for constructing the client objects we recommend for most -users. In some cases, those will be classes provided by an underlying versioned -client; in other cases, they will be handwritten higher-level client objects -with additional capabilities, convenience methods, or best practices built in. -Generally, the main client will default to a recommended service version, -although in some cases you can override this if you need to talk to a specific -service version. - -### Why would I want to use the main client? - -We recommend that most users install the main client gem for a service. You can -identify this gem as the one _without_ a version in its name, e.g. -`google-cloud-secret_manager`. -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-secret_manager-v1`. - -### What about the google-apis- clients? - -Client library gems with names that begin with `google-apis-` are based on an -older code generation technology. They talk to a REST/JSON backend (whereas -most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may -not offer the same performance, features, and ease of use provided by more -modern clients. - -The `google-apis-` clients have wide coverage across Google services, so you -might need to use one if there is no modern client available for the service. -However, if a modern client is available, we generally recommend it over the -older `google-apis-` clients. diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/Rakefile b/owl-bot-staging/google-cloud-secret_manager-v1/Rakefile deleted file mode 100644 index 47dd5c67678f..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["SECRET_MANAGER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["SECRET_MANAGER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["SECRET_MANAGER_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 SECRET_MANAGER_TEST_PROJECT=test123 SECRET_MANAGER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/secret_manager/v1/secret_manager_service/credentials" - ::Google::Cloud::SecretManager::V1::SecretManagerService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["SECRET_MANAGER_PROJECT"] = project - ENV["SECRET_MANAGER_TEST_PROJECT"] = project - ENV["SECRET_MANAGER_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-secret_manager-v1 gem has no acceptance tests." - end - end - - desc "Run acceptance cleanup." - task :cleanup do - end -end - -task :samples do - Rake::Task["samples:latest"].invoke -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-secret_manager-v1 gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-secret_manager-v1 gem has no samples to test." - end - end -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - y.options << "--fail-on-warning" -end - -desc "Run yard-doctest example tests." -task :doctest do - puts "The google-cloud-secret_manager-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-secret_manager-v1" - header "google-cloud-secret_manager-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-secret_manager-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-secret_manager-v1 test", "*" - Rake::Task[:test].invoke -end - -namespace :ci do - desc "Run the CI build, with smoke tests." - task :smoke_test do - Rake::Task[:ci].invoke - header "google-cloud-secret_manager-v1 smoke_test", "*" - Rake::Task[:smoke_test].invoke - end - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-secret_manager-v1 acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task default: :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-secret_manager-v1/gapic_metadata.json deleted file mode 100644 index 3964d548b435..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/gapic_metadata.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.secretmanager.v1", - "libraryPackage": "::Google::Cloud::SecretManager::V1", - "services": { - "SecretManagerService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client", - "rpcs": { - "ListSecrets": { - "methods": [ - "list_secrets" - ] - }, - "CreateSecret": { - "methods": [ - "create_secret" - ] - }, - "AddSecretVersion": { - "methods": [ - "add_secret_version" - ] - }, - "GetSecret": { - "methods": [ - "get_secret" - ] - }, - "UpdateSecret": { - "methods": [ - "update_secret" - ] - }, - "DeleteSecret": { - "methods": [ - "delete_secret" - ] - }, - "ListSecretVersions": { - "methods": [ - "list_secret_versions" - ] - }, - "GetSecretVersion": { - "methods": [ - "get_secret_version" - ] - }, - "AccessSecretVersion": { - "methods": [ - "access_secret_version" - ] - }, - "DisableSecretVersion": { - "methods": [ - "disable_secret_version" - ] - }, - "EnableSecretVersion": { - "methods": [ - "enable_secret_version" - ] - }, - "DestroySecretVersion": { - "methods": [ - "destroy_secret_version" - ] - }, - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - }, - "EnableManagedRotation": { - "methods": [ - "enable_managed_rotation" - ] - }, - "RotateSecret": { - "methods": [ - "rotate_secret" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/google-cloud-secret_manager-v1.gemspec b/owl-bot-staging/google-cloud-secret_manager-v1/google-cloud-secret_manager-v1.gemspec deleted file mode 100644 index 18cfe2f732c5..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/google-cloud-secret_manager-v1.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/secret_manager/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-secret_manager-v1" - gem.version = Google::Cloud::SecretManager::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Secret Manager is a secure and convenient storage system for API keys, passwords, certificates, and other sensitive data. Secret Manager provides a central place and single source of truth to manage, access, and audit secrets across Google Cloud. Note that google-cloud-secret_manager-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-secret_manager instead. See the readme for more details." - gem.summary = "Stores sensitive data such as API keys, passwords, and certificates. Provides convenience while improving security." - 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.2" - - gem.add_dependency "gapic-common", "~> 1.3" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google-cloud-secret_manager-v1.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google-cloud-secret_manager-v1.rb deleted file mode 100644 index 7a966609a639..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google-cloud-secret_manager-v1.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/secret_manager/v1" diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1.rb deleted file mode 100644 index 7ea91d418dcd..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1.rb +++ /dev/null @@ -1,45 +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/secret_manager/v1/secret_manager_service" -require "google/cloud/secret_manager/v1/version" - -module Google - module Cloud - module SecretManager - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/secret_manager/v1" - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/secret_manager/v1" - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/secret_manager/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/bindings_override.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/bindings_override.rb deleted file mode 100644 index fc80b7225c1e..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/bindings_override.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! - -require "gapic/rest" - -module Google - module Cloud - module SecretManager - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/secret_manager/v1/rest" - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "SecretManager"] - 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 = ::Gapic::Rest::HttpBindingOverrideConfiguration.new parent_config - default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/rest.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/rest.rb deleted file mode 100644 index 4131c19cc0dc..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/rest.rb +++ /dev/null @@ -1,38 +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/secret_manager/v1/secret_manager_service/rest" -require "google/cloud/secret_manager/v1/bindings_override" -require "google/cloud/secret_manager/v1/version" - -module Google - module Cloud - module SecretManager - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/secret_manager/v1/rest" - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service.rb deleted file mode 100644 index 951657359f0c..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service.rb +++ /dev/null @@ -1,61 +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/secret_manager/v1/version" - -require "google/cloud/secret_manager/v1/secret_manager_service/credentials" -require "google/cloud/secret_manager/v1/secret_manager_service/paths" -require "google/cloud/secret_manager/v1/secret_manager_service/client" -require "google/cloud/secret_manager/v1/secret_manager_service/rest" - -module Google - module Cloud - module SecretManager - module V1 - ## - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::SecretManager::V1::Secret Secret} - # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/secret_manager/v1/secret_manager_service" - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/secret_manager/v1/secret_manager_service/rest" - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - module SecretManagerService - end - end - end - end -end - -helper_path = ::File.join __dir__, "secret_manager_service", "helpers.rb" -require "google/cloud/secret_manager/v1/secret_manager_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb deleted file mode 100644 index 8d3d673b37d3..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/client.rb +++ /dev/null @@ -1,2189 +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/cloud/secretmanager/v1/service_pb" -require "google/cloud/location" - -module Google - module Cloud - module SecretManager - module V1 - module SecretManagerService - ## - # Client for the SecretManagerService service. - # - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::SecretManager::V1::Secret Secret} - # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :secret_manager_service_stub - - ## - # Configure the SecretManagerService Client class. - # - # See {::Google::Cloud::SecretManager::V1::SecretManagerService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecretManagerService clients - # ::Google::Cloud::SecretManager::V1::SecretManagerService::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", "SecretManager", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_secrets.timeout = 60.0 - - default_config.rpcs.create_secret.timeout = 60.0 - - default_config.rpcs.add_secret_version.timeout = 60.0 - - default_config.rpcs.get_secret.timeout = 60.0 - - default_config.rpcs.update_secret.timeout = 60.0 - - default_config.rpcs.delete_secret.timeout = 60.0 - - default_config.rpcs.list_secret_versions.timeout = 60.0 - - default_config.rpcs.get_secret_version.timeout = 60.0 - - default_config.rpcs.access_secret_version.timeout = 60.0 - default_config.rpcs.access_secret_version.retry_policy = { - initial_delay: 2.0, max_delay: 60.0, multiplier: 2.0, retry_codes: [14, 8] - } - - default_config.rpcs.disable_secret_version.timeout = 60.0 - - default_config.rpcs.enable_secret_version.timeout = 60.0 - - default_config.rpcs.destroy_secret_version.timeout = 60.0 - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - - default_config.rpcs.test_iam_permissions.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SecretManagerService 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::SecretManager::V1::SecretManagerService::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 - @secret_manager_service_stub.universe_domain - end - - ## - # Create a new SecretManagerService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecretManagerService client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/cloud/secretmanager/v1/service_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 - - @secret_manager_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::SecretManager::V1::SecretManagerService::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 - ) - - @secret_manager_service_stub.stub_logger&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @secret_manager_service_stub.endpoint - config.universe_domain = @secret_manager_service_stub.universe_domain - config.logger = @secret_manager_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @secret_manager_service_stub.logger - end - - # Service calls - - ## - # Lists {::Google::Cloud::SecretManager::V1::Secret Secrets}. - # - # @overload list_secrets(request, options = nil) - # Pass arguments to `list_secrets` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::ListSecretsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::ListSecretsRequest, ::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_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_secrets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project associated with the - # {::Google::Cloud::SecretManager::V1::Secret Secrets}, in the format `projects/*` - # or `projects/*/locations/*` - # @param page_size [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::SecretManager::V1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. - # @param filter [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secrets matching the filter. If filter is empty, all secrets are - # listed. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::ListSecretsRequest.new - # - # # Call the list_secrets method. - # result = client.list_secrets 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::SecretManager::V1::Secret. - # p item - # end - # - def list_secrets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretsRequest - - # 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_secrets.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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_secrets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_secrets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :list_secrets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, 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 a new {::Google::Cloud::SecretManager::V1::Secret Secret} containing no - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. - # - # @overload create_secret(request, options = nil) - # Pass arguments to `create_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::CreateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::CreateSecretRequest, ::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_secret(parent: nil, secret_id: nil, secret: nil) - # Pass arguments to `create_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project to associate with the - # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format `projects/*` - # or `projects/*/locations/*`. - # @param secret_id [::String] - # Required. This must be unique within the project. - # - # A secret ID is a string with a maximum length of 255 characters and can - # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and - # underscore (`_`) characters. - # @param secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash] - # Required. A {::Google::Cloud::SecretManager::V1::Secret Secret} with initial - # field values. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::Secret] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::CreateSecretRequest.new - # - # # Call the create_secret method. - # result = client.create_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - # p result - # - def create_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::CreateSecretRequest - - # 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_secret.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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.create_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :create_secret, 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 {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} - # containing secret data and attaches it to an existing - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload add_secret_version(request, options = nil) - # Pass arguments to `add_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::AddSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest, ::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 add_secret_version(parent: nil, payload: nil) - # Pass arguments to `add_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @param payload [::Google::Cloud::SecretManager::V1::SecretPayload, ::Hash] - # Required. The secret payload of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new - # - # # Call the add_secret_version method. - # result = client.add_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def add_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest - - # 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.add_secret_version.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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.add_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :add_secret_version, 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 metadata for a given {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload get_secret(request, options = nil) - # Pass arguments to `get_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::GetSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::GetSecretRequest, ::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_secret(name: nil) - # Pass arguments to `get_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::Secret] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::GetSecretRequest.new - # - # # Call the get_secret method. - # result = client.get_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - # p result - # - def get_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretRequest - - # 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_secret.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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :get_secret, 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 metadata of an existing - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload update_secret(request, options = nil) - # Pass arguments to `update_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::UpdateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::UpdateSecretRequest, ::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_secret(secret: nil, update_mask: nil) - # Pass arguments to `update_secret` 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 secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash] - # Required. {::Google::Cloud::SecretManager::V1::Secret Secret} with updated field - # values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Specifies the fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::Secret] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::UpdateSecretRequest.new - # - # # Call the update_secret method. - # result = client.update_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - # p result - # - def update_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::UpdateSecretRequest - - # 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_secret.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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.secret&.name - header_params["secret.name"] = request.secret.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_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :update_secret, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload delete_secret(request, options = nil) - # Pass arguments to `delete_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::DeleteSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::DeleteSecretRequest, ::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_secret(name: nil, etag: nil) - # Pass arguments to `delete_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to delete in the format - # `projects/*/secrets/*`. - # @param etag [::String] - # Optional. Etag of the {::Google::Cloud::SecretManager::V1::Secret Secret}. The - # request succeeds if it matches the etag of the currently stored secret - # object. If the etag is omitted, the request succeeds. - # - # @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/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::DeleteSecretRequest.new - # - # # Call the delete_secret method. - # result = client.delete_secret request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DeleteSecretRequest - - # 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_secret.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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :delete_secret, 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 {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. This - # call does not return secret data. - # - # @overload list_secret_versions(request, options = nil) - # Pass arguments to `list_secret_versions` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest, ::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_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_secret_versions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} associated with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} to list, in - # the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @param page_size [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # ListSecretVersionsResponse.next_page_token][]. - # @param filter [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secret versions matching the filter. If filter is empty, all secret - # versions are listed. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new - # - # # Call the list_secret_versions method. - # result = client.list_secret_versions 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::SecretManager::V1::SecretVersion. - # p item - # end - # - def list_secret_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest - - # 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_secret_versions.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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_secret_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :list_secret_versions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, 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 - - ## - # Gets metadata for a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # `projects/*/secrets/*/versions/latest` is an alias to the most recently - # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # @overload get_secret_version(request, options = nil) - # Pass arguments to `get_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::GetSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest, ::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_secret_version(name: nil) - # Pass arguments to `get_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new - # - # # Call the get_secret_version method. - # result = client.get_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def get_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest - - # 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_secret_version.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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :get_secret_version, 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 - - ## - # Accesses a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # This call returns the secret data. - # - # `projects/*/secrets/*/versions/latest` is an alias to the most recently - # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # @overload access_secret_version(request, options = nil) - # Pass arguments to `access_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest, ::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 access_secret_version(name: nil) - # Pass arguments to `access_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new - # - # # Call the access_secret_version method. - # result = client.access_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::AccessSecretVersionResponse. - # p result - # - def access_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest - - # 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.access_secret_version.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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.access_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :access_secret_version, 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 - - ## - # Disables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DISABLED DISABLED}. - # - # @overload disable_secret_version(request, options = nil) - # Pass arguments to `disable_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest, ::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_secret_version(name: nil, etag: nil) - # Pass arguments to `disable_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to disable in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new - # - # # Call the disable_secret_version method. - # result = client.disable_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def disable_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest - - # 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_secret_version.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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.disable_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :disable_secret_version, 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 - - ## - # Enables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1::SecretVersion::State::ENABLED ENABLED}. - # - # @overload enable_secret_version(request, options = nil) - # Pass arguments to `enable_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest, ::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 enable_secret_version(name: nil, etag: nil) - # Pass arguments to `enable_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to enable in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new - # - # # Call the enable_secret_version method. - # result = client.enable_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def enable_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest - - # 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.enable_secret_version.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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.enable_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :enable_secret_version, 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 - - ## - # Destroys a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DESTROYED DESTROYED} - # and irrevocably destroys the secret data. - # - # @overload destroy_secret_version(request, options = nil) - # Pass arguments to `destroy_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest, ::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 destroy_secret_version(name: nil, etag: nil) - # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to destroy in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new - # - # # Call the destroy_secret_version method. - # result = client.destroy_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def destroy_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest - - # 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.destroy_secret_version.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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout, - metadata: metadata, - retry_policy: @config.rpcs.destroy_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :destroy_secret_version, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on the specified secret. Replaces any - # existing policy. - # - # Permissions on - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} are enforced - # according to the policy set on the associated - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @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/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a secret. - # Returns empty policy if the secret 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/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has for the specified secret. - # If the secret does not exist, this call returns 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/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.resource - header_params["resource"] = request.resource - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Enables the managed rotation feature for a - # {::Google::Cloud::SecretManager::V1::Secret Secret}. This method can only be - # triggered once for a secret. In order to do further rotations, RotateSecret - # should be used. This method will add a secret version and update the - # password in Cloud SQL. - # - # @overload enable_managed_rotation(request, options = nil) - # Pass arguments to `enable_managed_rotation` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest, ::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 enable_managed_rotation(parent: nil, cloud_sql_single_user_credentials: nil) - # Pass arguments to `enable_managed_rotation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @param cloud_sql_single_user_credentials [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest::CloudSQLSingleUserCredentials, ::Hash] - # Credentials required for Cloud SQL DB for Single user Managed Rotation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new - # - # # Call the enable_managed_rotation method. - # result = client.enable_managed_rotation request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def enable_managed_rotation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest - - # 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.enable_managed_rotation.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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.enable_managed_rotation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.enable_managed_rotation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :enable_managed_rotation, 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 - - ## - # Do a managed rotation for a {::Google::Cloud::SecretManager::V1::Secret Secret}. - # This can only be triggered after Managed rotation has been enabled. - # This method will add a secret version and update the password in Cloud SQL. - # - # @overload rotate_secret(request, options = nil) - # Pass arguments to `rotate_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::RotateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::RotateSecretRequest, ::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 rotate_secret(parent: nil) - # Pass arguments to `rotate_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::RotateSecretRequest.new - # - # # Call the rotate_secret method. - # result = client.rotate_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def rotate_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::RotateSecretRequest - - # 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.rotate_secret.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::SecretManager::V1::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.parent - header_params["parent"] = request.parent - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.rotate_secret.timeout, - metadata: metadata, - retry_policy: @config.rpcs.rotate_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.call_rpc :rotate_secret, 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 SecretManagerService API. - # - # This class represents the configuration for SecretManagerService, - # 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::SecretManager::V1::SecretManagerService::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_secrets to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_secrets.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_secrets.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::SecretManager::V1::SecretManagerService::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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "secretmanager.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 SecretManagerService 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_secrets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_secrets - ## - # RPC-specific configuration for `create_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :create_secret - ## - # RPC-specific configuration for `add_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :add_secret_version - ## - # RPC-specific configuration for `get_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :get_secret - ## - # RPC-specific configuration for `update_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :update_secret - ## - # RPC-specific configuration for `delete_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_secret - ## - # RPC-specific configuration for `list_secret_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_secret_versions - ## - # RPC-specific configuration for `get_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :get_secret_version - ## - # RPC-specific configuration for `access_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :access_secret_version - ## - # RPC-specific configuration for `disable_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_secret_version - ## - # RPC-specific configuration for `enable_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_secret_version - ## - # RPC-specific configuration for `destroy_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :destroy_secret_version - ## - # 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 - ## - # RPC-specific configuration for `enable_managed_rotation` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_managed_rotation - ## - # RPC-specific configuration for `rotate_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :rotate_secret - - # @private - def initialize parent_rpcs = nil - list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets - @list_secrets = ::Gapic::Config::Method.new list_secrets_config - create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret - @create_secret = ::Gapic::Config::Method.new create_secret_config - add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version - @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config - get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret - @get_secret = ::Gapic::Config::Method.new get_secret_config - update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret - @update_secret = ::Gapic::Config::Method.new update_secret_config - delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret - @delete_secret = ::Gapic::Config::Method.new delete_secret_config - list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions - @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config - get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version - @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config - access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version - @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config - disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version - @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config - enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version - @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config - destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version - @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_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 - 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 - enable_managed_rotation_config = parent_rpcs.enable_managed_rotation if parent_rpcs.respond_to? :enable_managed_rotation - @enable_managed_rotation = ::Gapic::Config::Method.new enable_managed_rotation_config - rotate_secret_config = parent_rpcs.rotate_secret if parent_rpcs.respond_to? :rotate_secret - @rotate_secret = ::Gapic::Config::Method.new rotate_secret_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.rb deleted file mode 100644 index b47fca61abf1..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/credentials.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! - -require "googleauth" - -module Google - module Cloud - module SecretManager - module V1 - module SecretManagerService - # Credentials for the SecretManagerService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "SECRET_MANAGER_CREDENTIALS", - "SECRET_MANAGER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "SECRET_MANAGER_CREDENTIALS_JSON", - "SECRET_MANAGER_KEYFILE_JSON", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb deleted file mode 100644 index 426a2a6ef38b..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/paths.rb +++ /dev/null @@ -1,167 +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 SecretManager - module V1 - module SecretManagerService - # Path helper methods for the SecretManagerService API. - module Paths - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified Project resource string. - # - # The resource will be in the following format: - # - # `projects/{project}` - # - # @param project [String] - # - # @return [::String] - def project_path project: - "projects/#{project}" - end - - ## - # Create a fully-qualified Secret resource string. - # - # @overload secret_path(project:, secret:) - # The resource will be in the following format: - # - # `projects/{project}/secrets/{secret}` - # - # @param project [String] - # @param secret [String] - # - # @overload secret_path(project:, location:, secret:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/secrets/{secret}` - # - # @param project [String] - # @param location [String] - # @param secret [String] - # - # @return [::String] - def secret_path **args - resources = { - "project:secret" => (proc do |project:, secret:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/secrets/#{secret}" - end), - "location:project:secret" => (proc do |project:, location:, secret:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/secrets/#{secret}" - 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 SecretVersion resource string. - # - # @overload secret_version_path(project:, secret:, secret_version:) - # The resource will be in the following format: - # - # `projects/{project}/secrets/{secret}/versions/{secret_version}` - # - # @param project [String] - # @param secret [String] - # @param secret_version [String] - # - # @overload secret_version_path(project:, location:, secret:, secret_version:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}` - # - # @param project [String] - # @param location [String] - # @param secret [String] - # @param secret_version [String] - # - # @return [::String] - def secret_version_path **args - resources = { - "project:secret:secret_version" => (proc do |project:, secret:, secret_version:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" - - "projects/#{project}/secrets/#{secret}/versions/#{secret_version}" - end), - "location:project:secret:secret_version" => (proc do |project:, location:, secret:, secret_version:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" - - "projects/#{project}/locations/#{location}/secrets/#{secret}/versions/#{secret_version}" - 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 Topic resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/topics/{topic}` - # - # @param project [String] - # @param topic [String] - # - # @return [::String] - def topic_path project:, topic: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/topics/#{topic}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb deleted file mode 100644 index 75d9fc9de126..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest.rb +++ /dev/null @@ -1,59 +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/secret_manager/v1/version" -require "google/cloud/secret_manager/v1/bindings_override" - -require "google/cloud/secret_manager/v1/secret_manager_service/credentials" -require "google/cloud/secret_manager/v1/secret_manager_service/paths" -require "google/cloud/secret_manager/v1/secret_manager_service/rest/client" - -module Google - module Cloud - module SecretManager - module V1 - ## - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::SecretManager::V1::Secret Secret} - # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/secret_manager/v1/secret_manager_service/rest" - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - module SecretManagerService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/secret_manager/v1/secret_manager_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb deleted file mode 100644 index 30a809f07a9c..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/client.rb +++ /dev/null @@ -1,2035 +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/cloud/secretmanager/v1/service_pb" -require "google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module SecretManager - module V1 - module SecretManagerService - module Rest - ## - # REST client for the SecretManagerService service. - # - # Secret Manager Service - # - # Manages secrets and operations using those secrets. Implements a REST - # model with the following objects: - # - # * {::Google::Cloud::SecretManager::V1::Secret Secret} - # * {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "secretmanager.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :secret_manager_service_stub - - ## - # Configure the SecretManagerService Client class. - # - # See {::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all SecretManagerService clients - # ::Google::Cloud::SecretManager::V1::SecretManagerService::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", "SecretManager", "V1"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.list_secrets.timeout = 60.0 - - default_config.rpcs.create_secret.timeout = 60.0 - - default_config.rpcs.add_secret_version.timeout = 60.0 - - default_config.rpcs.get_secret.timeout = 60.0 - - default_config.rpcs.update_secret.timeout = 60.0 - - default_config.rpcs.delete_secret.timeout = 60.0 - - default_config.rpcs.list_secret_versions.timeout = 60.0 - - default_config.rpcs.get_secret_version.timeout = 60.0 - - default_config.rpcs.access_secret_version.timeout = 60.0 - default_config.rpcs.access_secret_version.retry_policy = { - initial_delay: 2.0, max_delay: 60.0, multiplier: 2.0, retry_codes: [14, 8] - } - - default_config.rpcs.disable_secret_version.timeout = 60.0 - - default_config.rpcs.enable_secret_version.timeout = 60.0 - - default_config.rpcs.destroy_secret_version.timeout = 60.0 - - default_config.rpcs.set_iam_policy.timeout = 60.0 - - default_config.rpcs.get_iam_policy.timeout = 60.0 - - default_config.rpcs.test_iam_permissions.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the SecretManagerService 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::SecretManager::V1::SecretManagerService::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 - @secret_manager_service_stub.universe_domain - end - - ## - # Create a new SecretManagerService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the SecretManagerService 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 - - @secret_manager_service_stub = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @secret_manager_service_stub.logger(stub: true)&.info do |entry| - entry.set_system_name - entry.set_service - entry.message = "Created client for #{entry.service}" - entry.set_credentials_fields credentials - entry.set "customEndpoint", @config.endpoint if @config.endpoint - entry.set "defaultTimeout", @config.timeout if @config.timeout - entry.set "quotaProject", @quota_project_id if @quota_project_id - end - - @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @secret_manager_service_stub.endpoint - config.universe_domain = @secret_manager_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @secret_manager_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @secret_manager_service_stub.logger - end - - # Service calls - - ## - # Lists {::Google::Cloud::SecretManager::V1::Secret Secrets}. - # - # @overload list_secrets(request, options = nil) - # Pass arguments to `list_secrets` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::ListSecretsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::ListSecretsRequest, ::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_secrets(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_secrets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project associated with the - # {::Google::Cloud::SecretManager::V1::Secret Secrets}, in the format `projects/*` - # or `projects/*/locations/*` - # @param page_size [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::SecretManager::V1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. - # @param filter [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secrets matching the filter. If filter is empty, all secrets are - # listed. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::Secret>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::ListSecretsRequest.new - # - # # Call the list_secrets method. - # result = client.list_secrets 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::SecretManager::V1::Secret. - # p item - # end - # - def list_secrets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_secrets.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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_secrets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_secrets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.list_secrets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secrets, "secrets", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new {::Google::Cloud::SecretManager::V1::Secret Secret} containing no - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. - # - # @overload create_secret(request, options = nil) - # Pass arguments to `create_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::CreateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::CreateSecretRequest, ::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_secret(parent: nil, secret_id: nil, secret: nil) - # Pass arguments to `create_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the project to associate with the - # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format `projects/*` - # or `projects/*/locations/*`. - # @param secret_id [::String] - # Required. This must be unique within the project. - # - # A secret ID is a string with a maximum length of 255 characters and can - # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and - # underscore (`_`) characters. - # @param secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash] - # Required. A {::Google::Cloud::SecretManager::V1::Secret Secret} with initial - # field values. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::CreateSecretRequest.new - # - # # Call the create_secret method. - # result = client.create_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - # p result - # - def create_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::CreateSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.create_secret.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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.create_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.create_secret request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Creates a new {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} - # containing secret data and attaches it to an existing - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload add_secret_version(request, options = nil) - # Pass arguments to `add_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::AddSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest, ::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 add_secret_version(parent: nil, payload: nil) - # Pass arguments to `add_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @param payload [::Google::Cloud::SecretManager::V1::SecretPayload, ::Hash] - # Required. The secret payload of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new - # - # # Call the add_secret_version method. - # result = client.add_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def add_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest - - # 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.add_secret_version.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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.add_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.add_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.add_secret_version 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 metadata for a given {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload get_secret(request, options = nil) - # Pass arguments to `get_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::GetSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::GetSecretRequest, ::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_secret(name: nil) - # Pass arguments to `get_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::GetSecretRequest.new - # - # # Call the get_secret method. - # result = client.get_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - # p result - # - def get_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretRequest - - # 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_secret.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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.get_secret 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 metadata of an existing - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload update_secret(request, options = nil) - # Pass arguments to `update_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::UpdateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::UpdateSecretRequest, ::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_secret(secret: nil, update_mask: nil) - # Pass arguments to `update_secret` 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 secret [::Google::Cloud::SecretManager::V1::Secret, ::Hash] - # Required. {::Google::Cloud::SecretManager::V1::Secret Secret} with updated field - # values. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Specifies the fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::UpdateSecretRequest.new - # - # # Call the update_secret method. - # result = client.update_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - # p result - # - def update_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::UpdateSecretRequest - - # 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_secret.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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.update_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.update_secret request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload delete_secret(request, options = nil) - # Pass arguments to `delete_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::DeleteSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::DeleteSecretRequest, ::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_secret(name: nil, etag: nil) - # Pass arguments to `delete_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to delete in the format - # `projects/*/secrets/*`. - # @param etag [::String] - # Optional. Etag of the {::Google::Cloud::SecretManager::V1::Secret Secret}. The - # request succeeds if it matches the etag of the currently stored secret - # object. If the etag is omitted, the request succeeds. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::DeleteSecretRequest.new - # - # # Call the delete_secret method. - # result = client.delete_secret request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DeleteSecretRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_secret.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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.delete_secret request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. This - # call does not return secret data. - # - # @overload list_secret_versions(request, options = nil) - # Pass arguments to `list_secret_versions` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest, ::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_secret_versions(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_secret_versions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} associated with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} to list, in - # the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @param page_size [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @param page_token [::String] - # Optional. Pagination token, returned earlier via - # ListSecretVersionsResponse.next_page_token][]. - # @param filter [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secret versions matching the filter. If filter is empty, all secret - # versions are listed. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::SecretManager::V1::SecretVersion>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new - # - # # Call the list_secret_versions method. - # result = client.list_secret_versions 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::SecretManager::V1::SecretVersion. - # p item - # end - # - def list_secret_versions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_secret_versions.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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_secret_versions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_secret_versions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.list_secret_versions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @secret_manager_service_stub, :list_secret_versions, "versions", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets metadata for a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # `projects/*/secrets/*/versions/latest` is an alias to the most recently - # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # @overload get_secret_version(request, options = nil) - # Pass arguments to `get_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::GetSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest, ::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_secret_version(name: nil) - # Pass arguments to `get_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new - # - # # Call the get_secret_version method. - # result = client.get_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def get_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest - - # 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_secret_version.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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.get_secret_version 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 - - ## - # Accesses a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # This call returns the secret data. - # - # `projects/*/secrets/*/versions/latest` is an alias to the most recently - # created {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # @overload access_secret_version(request, options = nil) - # Pass arguments to `access_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest, ::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 access_secret_version(name: nil) - # Pass arguments to `access_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new - # - # # Call the access_secret_version method. - # result = client.access_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::AccessSecretVersionResponse. - # p result - # - def access_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest - - # 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.access_secret_version.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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.access_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.access_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.access_secret_version 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 - - ## - # Disables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DISABLED DISABLED}. - # - # @overload disable_secret_version(request, options = nil) - # Pass arguments to `disable_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest, ::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_secret_version(name: nil, etag: nil) - # Pass arguments to `disable_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to disable in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new - # - # # Call the disable_secret_version method. - # result = client.disable_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def disable_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest - - # 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.disable_secret_version.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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.disable_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.disable_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.disable_secret_version 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 - - ## - # Enables a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1::SecretVersion::State::ENABLED ENABLED}. - # - # @overload enable_secret_version(request, options = nil) - # Pass arguments to `enable_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest, ::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 enable_secret_version(name: nil, etag: nil) - # Pass arguments to `enable_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to enable in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new - # - # # Call the enable_secret_version method. - # result = client.enable_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def enable_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest - - # 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.enable_secret_version.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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.enable_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.enable_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.enable_secret_version 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 - - ## - # Destroys a {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # - # Sets the {::Google::Cloud::SecretManager::V1::SecretVersion#state state} of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to - # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DESTROYED DESTROYED} - # and irrevocably destroys the secret data. - # - # @overload destroy_secret_version(request, options = nil) - # Pass arguments to `destroy_secret_version` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest, ::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 destroy_secret_version(name: nil, etag: nil) - # Pass arguments to `destroy_secret_version` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to destroy in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @param etag [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new - # - # # Call the destroy_secret_version method. - # result = client.destroy_secret_version request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def destroy_secret_version request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest - - # 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.destroy_secret_version.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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.destroy_secret_version.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.destroy_secret_version.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.destroy_secret_version request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Sets the access control policy on the specified secret. Replaces any - # existing policy. - # - # Permissions on - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} are enforced - # according to the policy set on the associated - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.set_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a secret. - # Returns empty policy if the secret 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/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.get_iam_policy request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has for the specified secret. - # If the secret does not exist, this call returns 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/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.test_iam_permissions request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Enables the managed rotation feature for a - # {::Google::Cloud::SecretManager::V1::Secret Secret}. This method can only be - # triggered once for a secret. In order to do further rotations, RotateSecret - # should be used. This method will add a secret version and update the - # password in Cloud SQL. - # - # @overload enable_managed_rotation(request, options = nil) - # Pass arguments to `enable_managed_rotation` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest, ::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 enable_managed_rotation(parent: nil, cloud_sql_single_user_credentials: nil) - # Pass arguments to `enable_managed_rotation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @param cloud_sql_single_user_credentials [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest::CloudSQLSingleUserCredentials, ::Hash] - # Credentials required for Cloud SQL DB for Single user Managed Rotation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new - # - # # Call the enable_managed_rotation method. - # result = client.enable_managed_rotation request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def enable_managed_rotation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest - - # 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.enable_managed_rotation.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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.enable_managed_rotation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.enable_managed_rotation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.enable_managed_rotation 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 - - ## - # Do a managed rotation for a {::Google::Cloud::SecretManager::V1::Secret Secret}. - # This can only be triggered after Managed rotation has been enabled. - # This method will add a secret version and update the password in Cloud SQL. - # - # @overload rotate_secret(request, options = nil) - # Pass arguments to `rotate_secret` via a request object, either of type - # {::Google::Cloud::SecretManager::V1::RotateSecretRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::SecretManager::V1::RotateSecretRequest, ::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 rotate_secret(parent: nil) - # Pass arguments to `rotate_secret` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/secret_manager/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::SecretManager::V1::RotateSecretRequest.new - # - # # Call the rotate_secret method. - # result = client.rotate_secret request - # - # # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - # p result - # - def rotate_secret request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::SecretManager::V1::RotateSecretRequest - - # 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.rotate_secret.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::SecretManager::V1::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.rotate_secret.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.rotate_secret.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @secret_manager_service_stub.rotate_secret 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 SecretManagerService REST API. - # - # This class represents the configuration for SecretManagerService 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::SecretManager::V1::SecretManagerService::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_secrets to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_secrets.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_secrets.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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `: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 = "secretmanager.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 - - # @private - # Overrides for http bindings for the RPCs of this service - # are only used when this service is used as mixin, and only - # by the host service. - # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}] - config_attr :bindings_override, {}, ::Hash, nil - 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 SecretManagerService 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. - # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_secrets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_secrets - ## - # RPC-specific configuration for `create_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :create_secret - ## - # RPC-specific configuration for `add_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :add_secret_version - ## - # RPC-specific configuration for `get_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :get_secret - ## - # RPC-specific configuration for `update_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :update_secret - ## - # RPC-specific configuration for `delete_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_secret - ## - # RPC-specific configuration for `list_secret_versions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_secret_versions - ## - # RPC-specific configuration for `get_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :get_secret_version - ## - # RPC-specific configuration for `access_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :access_secret_version - ## - # RPC-specific configuration for `disable_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :disable_secret_version - ## - # RPC-specific configuration for `enable_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_secret_version - ## - # RPC-specific configuration for `destroy_secret_version` - # @return [::Gapic::Config::Method] - # - attr_reader :destroy_secret_version - ## - # 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 - ## - # RPC-specific configuration for `enable_managed_rotation` - # @return [::Gapic::Config::Method] - # - attr_reader :enable_managed_rotation - ## - # RPC-specific configuration for `rotate_secret` - # @return [::Gapic::Config::Method] - # - attr_reader :rotate_secret - - # @private - def initialize parent_rpcs = nil - list_secrets_config = parent_rpcs.list_secrets if parent_rpcs.respond_to? :list_secrets - @list_secrets = ::Gapic::Config::Method.new list_secrets_config - create_secret_config = parent_rpcs.create_secret if parent_rpcs.respond_to? :create_secret - @create_secret = ::Gapic::Config::Method.new create_secret_config - add_secret_version_config = parent_rpcs.add_secret_version if parent_rpcs.respond_to? :add_secret_version - @add_secret_version = ::Gapic::Config::Method.new add_secret_version_config - get_secret_config = parent_rpcs.get_secret if parent_rpcs.respond_to? :get_secret - @get_secret = ::Gapic::Config::Method.new get_secret_config - update_secret_config = parent_rpcs.update_secret if parent_rpcs.respond_to? :update_secret - @update_secret = ::Gapic::Config::Method.new update_secret_config - delete_secret_config = parent_rpcs.delete_secret if parent_rpcs.respond_to? :delete_secret - @delete_secret = ::Gapic::Config::Method.new delete_secret_config - list_secret_versions_config = parent_rpcs.list_secret_versions if parent_rpcs.respond_to? :list_secret_versions - @list_secret_versions = ::Gapic::Config::Method.new list_secret_versions_config - get_secret_version_config = parent_rpcs.get_secret_version if parent_rpcs.respond_to? :get_secret_version - @get_secret_version = ::Gapic::Config::Method.new get_secret_version_config - access_secret_version_config = parent_rpcs.access_secret_version if parent_rpcs.respond_to? :access_secret_version - @access_secret_version = ::Gapic::Config::Method.new access_secret_version_config - disable_secret_version_config = parent_rpcs.disable_secret_version if parent_rpcs.respond_to? :disable_secret_version - @disable_secret_version = ::Gapic::Config::Method.new disable_secret_version_config - enable_secret_version_config = parent_rpcs.enable_secret_version if parent_rpcs.respond_to? :enable_secret_version - @enable_secret_version = ::Gapic::Config::Method.new enable_secret_version_config - destroy_secret_version_config = parent_rpcs.destroy_secret_version if parent_rpcs.respond_to? :destroy_secret_version - @destroy_secret_version = ::Gapic::Config::Method.new destroy_secret_version_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 - 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 - enable_managed_rotation_config = parent_rpcs.enable_managed_rotation if parent_rpcs.respond_to? :enable_managed_rotation - @enable_managed_rotation = ::Gapic::Config::Method.new enable_managed_rotation_config - rotate_secret_config = parent_rpcs.rotate_secret if parent_rpcs.respond_to? :rotate_secret - @rotate_secret = ::Gapic::Config::Method.new rotate_secret_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb deleted file mode 100644 index 6e6dca662ea6..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/secret_manager_service/rest/service_stub.rb +++ /dev/null @@ -1,1257 +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/secretmanager/v1/service_pb" - -module Google - module Cloud - module SecretManager - module V1 - module SecretManagerService - module Rest - ## - # REST service stub for the SecretManagerService 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 list_secrets REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::ListSecretsRequest] - # 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::SecretManager::V1::ListSecretsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::ListSecretsResponse] - # A result object deserialized from the server's reply - def list_secrets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_secrets_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_secrets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::ListSecretsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the create_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::CreateSecretRequest] - # 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::SecretManager::V1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # A result object deserialized from the server's reply - def create_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_secret_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "create_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::Secret.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the add_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest] - # 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::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # A result object deserialized from the server's reply - def add_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_add_secret_version_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: "add_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::SecretVersion.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_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::GetSecretRequest] - # 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::SecretManager::V1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # A result object deserialized from the server's reply - def get_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_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_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::Secret.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_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::UpdateSecretRequest] - # 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::SecretManager::V1::Secret] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::Secret] - # A result object deserialized from the server's reply - def update_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_secret_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_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::Secret.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the delete_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::DeleteSecretRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_secret_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the list_secret_versions REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest] - # 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::SecretManager::V1::ListSecretVersionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse] - # A result object deserialized from the server's reply - def list_secret_versions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_secret_versions_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_secret_versions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse.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_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest] - # 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::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # A result object deserialized from the server's reply - def get_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_secret_version_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_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the access_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest] - # 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::SecretManager::V1::AccessSecretVersionResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse] - # A result object deserialized from the server's reply - def access_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_access_secret_version_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: "access_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the disable_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest] - # 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::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # A result object deserialized from the server's reply - def disable_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_disable_secret_version_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: "disable_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the enable_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest] - # 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::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # A result object deserialized from the server's reply - def enable_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_enable_secret_version_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: "enable_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the destroy_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest] - # 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::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # A result object deserialized from the server's reply - def destroy_secret_version request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_destroy_secret_version_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: "destroy_secret_version", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the 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 - - ## - # Baseline implementation for the enable_managed_rotation REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest] - # 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::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # A result object deserialized from the server's reply - def enable_managed_rotation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_enable_managed_rotation_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: "enable_managed_rotation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::SecretVersion.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the rotate_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::RotateSecretRequest] - # 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::SecretManager::V1::SecretVersion] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::SecretManager::V1::SecretVersion] - # A result object deserialized from the server's reply - def rotate_secret request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_rotate_secret_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: "rotate_secret", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::SecretManager::V1::SecretVersion.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 list_secrets REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::ListSecretsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_secrets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/secrets", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/secrets", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::CreateSecretRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_create_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/secrets", - body: "secret", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/secrets", - body: "secret", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the add_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::AddSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_add_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:addVersion", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:addVersion", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::GetSecretRequest] - # 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_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::UpdateSecretRequest] - # 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_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{secret.name}", - body: "secret", - matches: [ - ["secret.name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{secret.name}", - body: "secret", - matches: [ - ["secret.name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::DeleteSecretRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_secret_versions REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_secret_versions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/versions", - matches: [ - ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/versions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::GetSecretVersionRequest] - # 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_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the access_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_access_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}:access", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}:access", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the disable_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_disable_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:disable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:disable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the enable_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_enable_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:enable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:enable", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the destroy_secret_version REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_destroy_secret_version_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:destroy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:destroy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/versions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the enable_managed_rotation REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_enable_managed_rotation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:enableManagedRotation", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:enableManagedRotation", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the rotate_secret REST call - # - # @param request_pb [::Google::Cloud::SecretManager::V1::RotateSecretRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_rotate_secret_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:rotateSecret", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:rotateSecret", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/secrets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/version.rb deleted file mode 100644 index 3ac096ce123c..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secret_manager/v1/version.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! - - -module Google - module Cloud - module SecretManager - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb deleted file mode 100644 index c7770a98e7bb..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/resources_pb.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/secretmanager/v1/resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/iam/v1/resource_policy_member_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n-google/cloud/secretmanager/v1/resources.proto\x12\x1dgoogle.cloud.secretmanager.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/iam/v1/resource_policy_member.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xf9\x0b\n\x06Secret\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12G\n\x0breplication\x18\x02 \x01(\x0b\x32*.google.cloud.secretmanager.v1.ReplicationB\x06\xe0\x41\x05\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x06labels\x18\x04 \x03(\x0b\x32\x31.google.cloud.secretmanager.v1.Secret.LabelsEntry\x12\x39\n\x06topics\x18\x05 \x03(\x0b\x32$.google.cloud.secretmanager.v1.TopicB\x03\xe0\x41\x01\x12\x36\n\x0b\x65xpire_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01H\x00\x12-\n\x03ttl\x18\x07 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04H\x00\x12\x11\n\x04\x65tag\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12>\n\x08rotation\x18\t \x01(\x0b\x32\'.google.cloud.secretmanager.v1.RotationB\x03\xe0\x41\x01\x12W\n\x0fversion_aliases\x18\x0b \x03(\x0b\x32\x39.google.cloud.secretmanager.v1.Secret.VersionAliasesEntryB\x03\xe0\x41\x01\x12P\n\x0b\x61nnotations\x18\r \x03(\x0b\x32\x36.google.cloud.secretmanager.v1.Secret.AnnotationsEntryB\x03\xe0\x41\x01\x12;\n\x13version_destroy_ttl\x18\x0e \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x0f \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x12H\n\x04tags\x18\x10 \x03(\x0b\x32/.google.cloud.secretmanager.v1.Secret.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x12M\n\x0bsecret_type\x18\x11 \x01(\x0e\x32\x30.google.cloud.secretmanager.v1.Secret.SecretTypeB\x06\xe0\x41\x05\xe0\x41\x01\x12?\n\rpolicy_member\x18\x12 \x01(\x0b\x32#.google.iam.v1.ResourcePolicyMemberB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x35\n\x13VersionAliasesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8d\x01\n\nSecretType\x12\x1b\n\x17SECRET_TYPE_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x43LOUD_SQL_DB_CREDENTIALS\x10\x01\x12\x0e\n\nACCESS_KEY\x10\x02\x12\x0f\n\x0b\x43\x45RTIFICATE\x10\x03\x12\x18\n\x14OTHER_DB_CREDENTIALS\x10\x04\x12\t\n\x05OTHER\x10\x32:\x99\x01\xea\x41\x95\x01\n#secretmanager.googleapis.com/Secret\x12#projects/{project}/secrets/{secret}\x12\x38projects/{project}/locations/{location}/secrets/{secret}*\x07secrets2\x06secretB\x0c\n\nexpiration\"\xc2\x06\n\rSecretVersion\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x35\n\x0c\x64\x65stroy_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x46\n\x05state\x18\x04 \x01(\x0e\x32\x32.google.cloud.secretmanager.v1.SecretVersion.StateB\x03\xe0\x41\x03\x12L\n\x12replication_status\x18\x05 \x01(\x0b\x32\x30.google.cloud.secretmanager.v1.ReplicationStatus\x12\x11\n\x04\x65tag\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12.\n!client_specified_payload_checksum\x18\x07 \x01(\x08\x42\x03\xe0\x41\x03\x12?\n\x16scheduled_destroy_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12h\n\x1b\x63ustomer_managed_encryption\x18\t \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\"H\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x12\r\n\tDESTROYED\x10\x03:\xe2\x01\xea\x41\xde\x01\n*secretmanager.googleapis.com/SecretVersion\x12=projects/{project}/secrets/{secret}/versions/{secret_version}\x12Rprojects/{project}/locations/{location}/secrets/{secret}/versions/{secret_version}*\x0esecretVersions2\rsecretVersion\"\x90\x04\n\x0bReplication\x12I\n\tautomatic\x18\x01 \x01(\x0b\x32\x34.google.cloud.secretmanager.v1.Replication.AutomaticH\x00\x12N\n\x0cuser_managed\x18\x02 \x01(\x0b\x32\x36.google.cloud.secretmanager.v1.Replication.UserManagedH\x00\x1ao\n\tAutomatic\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x01 \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x1a\xe5\x01\n\x0bUserManaged\x12U\n\x08replicas\x18\x01 \x03(\x0b\x32>.google.cloud.secretmanager.v1.Replication.UserManaged.ReplicaB\x03\xe0\x41\x02\x1a\x7f\n\x07Replica\x12\x10\n\x08location\x18\x01 \x01(\t\x12\x62\n\x1b\x63ustomer_managed_encryption\x18\x02 \x01(\x0b\x32\x38.google.cloud.secretmanager.v1.CustomerManagedEncryptionB\x03\xe0\x41\x01\x42\r\n\x0breplication\"6\n\x19\x43ustomerManagedEncryption\x12\x19\n\x0ckms_key_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"\xeb\x04\n\x11ReplicationStatus\x12U\n\tautomatic\x18\x01 \x01(\x0b\x32@.google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatusH\x00\x12Z\n\x0cuser_managed\x18\x02 \x01(\x0b\x32\x42.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatusH\x00\x1a{\n\x0f\x41utomaticStatus\x12h\n\x1b\x63ustomer_managed_encryption\x18\x01 \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\x1a\x8f\x02\n\x11UserManagedStatus\x12g\n\x08replicas\x18\x01 \x03(\x0b\x32P.google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatusB\x03\xe0\x41\x03\x1a\x90\x01\n\rReplicaStatus\x12\x15\n\x08location\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12h\n\x1b\x63ustomer_managed_encryption\x18\x02 \x01(\x0b\x32>.google.cloud.secretmanager.v1.CustomerManagedEncryptionStatusB\x03\xe0\x41\x03\x42\x14\n\x12replication_status\"D\n\x1f\x43ustomerManagedEncryptionStatus\x12!\n\x14kms_key_version_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"_\n\x05Topic\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08:C\xea\x41@\n\x1bpubsub.googleapis.com/Topic\x12!projects/{project}/topics/{topic}\"\xba\x03\n\x08Rotation\x12;\n\x12next_rotation_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12\x37\n\x0frotation_period\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x04\x12\x63\n\x17managed_rotation_status\x18\x03 \x01(\x0b\x32=.google.cloud.secretmanager.v1.Rotation.ManagedRotationStatusB\x03\xe0\x41\x03\x1a\xd2\x01\n\x15ManagedRotationStatus\x12W\n\x05state\x18\x01 \x01(\x0e\x32\x43.google.cloud.secretmanager.v1.Rotation.ManagedRotationStatus.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x02 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08INACTIVE\x10\x02\"L\n\rSecretPayload\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\x1d\n\x0b\x64\x61ta_crc32c\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x0e\n\x0c_data_crc32cB\xe7\x01\n!com.google.cloud.secretmanager.v1B\x0eResourcesProtoP\x01ZGcloud.google.com/go/secretmanager/apiv1/secretmanagerpb;secretmanagerpb\xa2\x02\x03GSM\xaa\x02\x1dGoogle.Cloud.SecretManager.V1\xca\x02\x1dGoogle\\Cloud\\SecretManager\\V1\xea\x02 Google::Cloud::SecretManager::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module SecretManager - module V1 - Secret = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Secret").msgclass - Secret::SecretType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Secret.SecretType").enummodule - SecretVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.SecretVersion").msgclass - SecretVersion::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.SecretVersion.State").enummodule - Replication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication").msgclass - Replication::Automatic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication.Automatic").msgclass - Replication::UserManaged = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication.UserManaged").msgclass - Replication::UserManaged::Replica = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Replication.UserManaged.Replica").msgclass - CustomerManagedEncryption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.CustomerManagedEncryption").msgclass - ReplicationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.ReplicationStatus").msgclass - ReplicationStatus::AutomaticStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.ReplicationStatus.AutomaticStatus").msgclass - ReplicationStatus::UserManagedStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus").msgclass - ReplicationStatus::UserManagedStatus::ReplicaStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.ReplicationStatus.UserManagedStatus.ReplicaStatus").msgclass - CustomerManagedEncryptionStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.CustomerManagedEncryptionStatus").msgclass - Topic = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Topic").msgclass - Rotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Rotation").msgclass - Rotation::ManagedRotationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Rotation.ManagedRotationStatus").msgclass - Rotation::ManagedRotationStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.Rotation.ManagedRotationStatus.State").enummodule - SecretPayload = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.secretmanager.v1.SecretPayload").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb b/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb deleted file mode 100644 index 66de23a46f13..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/lib/google/cloud/secretmanager/v1/service_pb.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/secretmanager/v1/service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/secretmanager/v1/resources_pb' -require 'google/iam/v1/iam_policy_pb' -require 'google/iam/v1/policy_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n+google/cloud/secretmanager/v1/service.proto\x12\x1dgoogle.cloud.secretmanager.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/secretmanager/v1/resources.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x97\x01\n\x12ListSecretsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#secretmanager.googleapis.com/Secret\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\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"z\n\x13ListSecretsResponse\x12\x36\n\x07secrets\x18\x01 \x03(\x0b\x32%.google.cloud.secretmanager.v1.Secret\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"\xa6\x01\n\x13\x43reateSecretRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#secretmanager.googleapis.com/Secret\x12\x16\n\tsecret_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12:\n\x06secret\x18\x03 \x01(\x0b\x32%.google.cloud.secretmanager.v1.SecretB\x03\xe0\x41\x02\"\x9a\x01\n\x17\x41\x64\x64SecretVersionRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x42\n\x07payload\x18\x02 \x01(\x0b\x32,.google.cloud.secretmanager.v1.SecretPayloadB\x03\xe0\x41\x02\"\xdc\x02\n\x1c\x45nableManagedRotationRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x86\x01\n!cloud_sql_single_user_credentials\x18\x02 \x01(\x0b\x32Y.google.cloud.secretmanager.v1.EnableManagedRotationRequest.CloudSQLSingleUserCredentialsH\x00\x1ag\n\x1d\x43loudSQLSingleUserCredentials\x12\x18\n\x0binstance_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08username\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08password\x18\x03 \x01(\tB\x03\xe0\x41\x01\x42\r\n\x0b\x63redentials\"R\n\x13RotateSecretRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\"M\n\x10GetSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\"\x9e\x01\n\x19ListSecretVersionsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\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\x06\x66ilter\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x89\x01\n\x1aListSecretVersionsResponse\x12>\n\x08versions\x18\x01 \x03(\x0b\x32,.google.cloud.secretmanager.v1.SecretVersion\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x12\n\ntotal_size\x18\x03 \x01(\x05\"[\n\x17GetSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x87\x01\n\x13UpdateSecretRequest\x12:\n\x06secret\x18\x01 \x01(\x0b\x32%.google.cloud.secretmanager.v1.SecretB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"^\n\x1a\x41\x63\x63\x65ssSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\"\x9b\x01\n\x1b\x41\x63\x63\x65ssSecretVersionResponse\x12=\n\x04name\x18\x01 \x01(\tB/\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12=\n\x07payload\x18\x02 \x01(\x0b\x32,.google.cloud.secretmanager.v1.SecretPayload\"c\n\x13\x44\x65leteSecretRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#secretmanager.googleapis.com/Secret\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"r\n\x1b\x44isableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"q\n\x1a\x45nableSecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"r\n\x1b\x44\x65stroySecretVersionRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*secretmanager.googleapis.com/SecretVersion\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x32\xa1!\n\x14SecretManagerService\x12\xd5\x01\n\x0bListSecrets\x12\x31.google.cloud.secretmanager.v1.ListSecretsRequest\x1a\x32.google.cloud.secretmanager.v1.ListSecretsResponse\"_\xda\x41\x06parent\x82\xd3\xe4\x93\x02P\x12\x1f/v1/{parent=projects/*}/secretsZ-\x12+/v1/{parent=projects/*/locations/*}/secrets\x12\xec\x01\n\x0c\x43reateSecret\x12\x32.google.cloud.secretmanager.v1.CreateSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"\x80\x01\xda\x41\x17parent,secret_id,secret\x82\xd3\xe4\x93\x02`\"\x1f/v1/{parent=projects/*}/secrets:\x06secretZ5\"+/v1/{parent=projects/*/locations/*}/secrets:\x06secret\x12\x82\x02\n\x10\x41\x64\x64SecretVersion\x12\x36.google.cloud.secretmanager.v1.AddSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x87\x01\xda\x41\x0eparent,payload\x82\xd3\xe4\x93\x02p\",/v1/{parent=projects/*/secrets/*}:addVersion:\x01*Z=\"8/v1/{parent=projects/*/locations/*/secrets/*}:addVersion:\x01*\x12\xc2\x01\n\tGetSecret\x12/.google.cloud.secretmanager.v1.GetSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"]\xda\x41\x04name\x82\xd3\xe4\x93\x02P\x12\x1f/v1/{name=projects/*/secrets/*}Z-\x12+/v1/{name=projects/*/locations/*/secrets/*}\x12\xf5\x01\n\x0cUpdateSecret\x12\x32.google.cloud.secretmanager.v1.UpdateSecretRequest\x1a%.google.cloud.secretmanager.v1.Secret\"\x89\x01\xda\x41\x12secret,update_mask\x82\xd3\xe4\x93\x02n2&/v1/{secret.name=projects/*/secrets/*}:\x06secretZ<22/v1/{secret.name=projects/*/locations/*/secrets/*}:\x06secret\x12\xb9\x01\n\x0c\x44\x65leteSecret\x12\x32.google.cloud.secretmanager.v1.DeleteSecretRequest\x1a\x16.google.protobuf.Empty\"]\xda\x41\x04name\x82\xd3\xe4\x93\x02P*\x1f/v1/{name=projects/*/secrets/*}Z-*+/v1/{name=projects/*/locations/*/secrets/*}\x12\x80\x02\n\x12ListSecretVersions\x12\x38.google.cloud.secretmanager.v1.ListSecretVersionsRequest\x1a\x39.google.cloud.secretmanager.v1.ListSecretVersionsResponse\"u\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x66\x12*/v1/{parent=projects/*/secrets/*}/versionsZ8\x12\x36/v1/{parent=projects/*/locations/*/secrets/*}/versions\x12\xed\x01\n\x10GetSecretVersion\x12\x36.google.cloud.secretmanager.v1.GetSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"s\xda\x41\x04name\x82\xd3\xe4\x93\x02\x66\x12*/v1/{name=projects/*/secrets/*/versions/*}Z8\x12\x36/v1/{name=projects/*/locations/*/secrets/*/versions/*}\x12\x90\x02\n\x13\x41\x63\x63\x65ssSecretVersion\x12\x39.google.cloud.secretmanager.v1.AccessSecretVersionRequest\x1a:.google.cloud.secretmanager.v1.AccessSecretVersionResponse\"\x81\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02t\x12\x31/v1/{name=projects/*/secrets/*/versions/*}:accessZ?\x12=/v1/{name=projects/*/locations/*/secrets/*/versions/*}:access\x12\x8c\x02\n\x14\x44isableSecretVersion\x12:.google.cloud.secretmanager.v1.DisableSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x89\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02|\"2/v1/{name=projects/*/secrets/*/versions/*}:disable:\x01*ZC\">/v1/{name=projects/*/locations/*/secrets/*/versions/*}:disable:\x01*\x12\x88\x02\n\x13\x45nableSecretVersion\x12\x39.google.cloud.secretmanager.v1.EnableSecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x87\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02z\"1/v1/{name=projects/*/secrets/*/versions/*}:enable:\x01*ZB\"=/v1/{name=projects/*/locations/*/secrets/*/versions/*}:enable:\x01*\x12\x8c\x02\n\x14\x44\x65stroySecretVersion\x12:.google.cloud.secretmanager.v1.DestroySecretVersionRequest\x1a,.google.cloud.secretmanager.v1.SecretVersion\"\x89\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02|\"2/v1/{name=projects/*/secrets/*/versions/*}:destroy:\x01*ZC\">/v1/{name=projects/*/locations/*/secrets/*/versions/*}:destroy:\x01*\x12\xc9\x01\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\"~\x82\xd3\xe4\x93\x02x\"0/v1/{resource=projects/*/secrets/*}:setIamPolicy:\x01*ZA\"\x12] - # 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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/resources.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/resources.rb deleted file mode 100644 index a762800fd0bc..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/resources.rb +++ /dev/null @@ -1,596 +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 SecretManager - module V1 - # A {::Google::Cloud::SecretManager::V1::Secret Secret} is a logical secret whose - # value and versions can be accessed. - # - # A {::Google::Cloud::SecretManager::V1::Secret Secret} is made up of zero or more - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} that represent - # the secret data. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} in the format - # `projects/*/secrets/*`. - # @!attribute [rw] replication - # @return [::Google::Cloud::SecretManager::V1::Replication] - # Optional. Immutable. The replication policy of the secret data attached to - # the {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # The replication policy cannot be changed after the Secret has been created. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the - # {::Google::Cloud::SecretManager::V1::Secret Secret} was created. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The labels assigned to this Secret. - # - # Label keys must be between 1 and 63 characters long, have a UTF-8 encoding - # of maximum 128 bytes, and must conform to the following PCRE regular - # expression: `[\p{Ll}\p{Lo}][\p{Ll}\p{Lo}\p{N}_-]{0,62}` - # - # Label values must be between 0 and 63 characters long, have a UTF-8 - # encoding of maximum 128 bytes, and must conform to the following PCRE - # regular expression: `[\p{Ll}\p{Lo}\p{N}_-]{0,63}` - # - # No more than 64 labels can be assigned to a given resource. - # @!attribute [rw] topics - # @return [::Array<::Google::Cloud::SecretManager::V1::Topic>] - # Optional. A list of up to 10 Pub/Sub topics to which messages are published - # when control plane operations are called on the secret or its versions. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Timestamp in UTC when the - # {::Google::Cloud::SecretManager::V1::Secret Secret} is scheduled to expire. - # This is always provided on output, regardless of what was sent on input. - # - # Note: The following fields are mutually exclusive: `expire_time`, `ttl`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # Input only. The TTL for the - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # Note: The following fields are mutually exclusive: `ttl`, `expire_time`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] etag - # @return [::String] - # Optional. Etag of the currently stored - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # @!attribute [rw] rotation - # @return [::Google::Cloud::SecretManager::V1::Rotation] - # Optional. Rotation policy attached to the - # {::Google::Cloud::SecretManager::V1::Secret Secret}. May be excluded if there is - # no rotation policy. - # @!attribute [rw] version_aliases - # @return [::Google::Protobuf::Map{::String => ::Integer}] - # Optional. Mapping from version alias to version name. - # - # A version alias is a string with a maximum length of 63 characters and can - # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) - # and underscore ('_') characters. An alias string must start with a - # letter and cannot be the string 'latest' or 'NEW'. - # No more than 50 aliases can be assigned to a given secret. - # - # Version-Alias pairs will be viewable via GetSecret and modifiable via - # UpdateSecret. Access by alias is only be supported on - # GetSecretVersion and AccessSecretVersion. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Custom metadata about the secret. - # - # Annotations are distinct from various forms of labels. - # Annotations exist to allow client tools to store their own state - # information without requiring a database. - # - # Annotation keys must be between 1 and 63 characters long, have a UTF-8 - # encoding of maximum 128 bytes, begin and end with an alphanumeric character - # ([a-z0-9A-Z]), and may have dashes (-), underscores (_), dots (.), and - # alphanumerics in between these symbols. - # - # The total size of annotation keys and values must be less than 16KiB. - # @!attribute [rw] version_destroy_ttl - # @return [::Google::Protobuf::Duration] - # Optional. Secret Version TTL after destruction request - # - # This is a part of the Delayed secret version destroy feature. - # For secret with TTL>0, version destruction doesn't happen immediately - # on calling destroy instead the version goes to a disabled state and - # destruction happens after the TTL expires. - # @!attribute [rw] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryption] - # Optional. The customer-managed encryption configuration of the regionalized - # secrets. If no configuration is provided, Google-managed default encryption - # is used. - # - # Updates to the {::Google::Cloud::SecretManager::V1::Secret Secret} encryption - # configuration only apply to - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} added - # afterwards. They do not apply retroactively to existing - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. - # @!attribute [rw] tags - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Input only. Immutable. Mapping of Tag keys/values directly bound - # to this resource. For example: - # "123/environment": "production", - # "123/costCenter": "marketing" - # - # Tags are used to organize and group resources. - # - # Tags can be used to control policy evaluation for the resource. - # @!attribute [rw] secret_type - # @return [::Google::Cloud::SecretManager::V1::Secret::SecretType] - # Optional. Immutable. This defines the type of the secret. - # Enforces certain structural requirements on the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. - # For secret of type UNSPECIFIED, the SecretVersions can be of any type. - # @!attribute [r] policy_member - # @return [::Google::Iam::V1::ResourcePolicyMember] - # Output only. Defines the policy member for the secret. - # This will be used to check if the caller has the permission to perform - # certain operations on the typed secret. - class Secret - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Integer] - class VersionAliasesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class TagsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # This defines the various values of the type of secret can be. - module SecretType - # Applicable to all secrets which do not have any restriction on the - # SecretVersions. - SECRET_TYPE_UNSPECIFIED = 0 - - # Applicable to secrets which are used for the managed rotation feature - # for Cloud SQL Single User. - CLOUD_SQL_DB_CREDENTIALS = 1 - - # Applicable to secrets where the payload contains an access key. - ACCESS_KEY = 2 - - # Applicable to secrets where the payload contains a certificate. - CERTIFICATE = 3 - - # Applicable to secrets where the payload contains database credentials. - OTHER_DB_CREDENTIALS = 4 - - # Applicable to secrets whose type doesn't belong to any of the above - # defined types. - OTHER = 50 - end - end - - # A secret version resource in the Secret Manager API. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*`. - # - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} IDs in a - # {::Google::Cloud::SecretManager::V1::Secret Secret} start at 1 and are - # incremented for each subsequent version of the secret. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} was created. - # @!attribute [r] destroy_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time this - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} was destroyed. - # Only present if {::Google::Cloud::SecretManager::V1::SecretVersion#state state} - # is - # {::Google::Cloud::SecretManager::V1::SecretVersion::State::DESTROYED DESTROYED}. - # @!attribute [r] state - # @return [::Google::Cloud::SecretManager::V1::SecretVersion::State] - # Output only. The current state of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @!attribute [rw] replication_status - # @return [::Google::Cloud::SecretManager::V1::ReplicationStatus] - # The replication status of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @!attribute [r] etag - # @return [::String] - # Output only. Etag of the currently stored - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @!attribute [r] client_specified_payload_checksum - # @return [::Boolean] - # Output only. True if payload checksum specified in - # {::Google::Cloud::SecretManager::V1::SecretPayload SecretPayload} object has - # been received by - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client SecretManagerService} - # on - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion}. - # @!attribute [r] scheduled_destroy_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Output only. Scheduled destroy time for secret version. - # This is a part of the Delayed secret version destroy feature. For a - # Secret with a valid version destroy TTL, when a secert version is - # destroyed, version is moved to disabled state and it is scheduled for - # destruction Version is destroyed only after the scheduled_destroy_time. - # @!attribute [r] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryptionStatus] - # Output only. The customer-managed encryption status of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. Only - # populated if customer-managed encryption is used and - # {::Google::Cloud::SecretManager::V1::Secret Secret} is a regionalized secret. - class SecretVersion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The state of a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}, indicating if - # it can be accessed. - module State - # Not specified. This value is unused and invalid. - STATE_UNSPECIFIED = 0 - - # The {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} may be - # accessed. - ENABLED = 1 - - # The {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} may not - # be accessed, but the secret data is still available and can be placed - # back into the - # {::Google::Cloud::SecretManager::V1::SecretVersion::State::ENABLED ENABLED} - # state. - DISABLED = 2 - - # The {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} is - # destroyed and the secret data is no longer stored. A version may not - # leave this state once entered. - DESTROYED = 3 - end - end - - # A policy that defines the replication and encryption configuration of data. - # @!attribute [rw] automatic - # @return [::Google::Cloud::SecretManager::V1::Replication::Automatic] - # The {::Google::Cloud::SecretManager::V1::Secret Secret} will automatically be - # replicated without any restrictions. - # - # Note: The following fields are mutually exclusive: `automatic`, `user_managed`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] user_managed - # @return [::Google::Cloud::SecretManager::V1::Replication::UserManaged] - # The {::Google::Cloud::SecretManager::V1::Secret Secret} will only be - # replicated into the locations specified. - # - # Note: The following fields are mutually exclusive: `user_managed`, `automatic`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Replication - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A replication policy that replicates the - # {::Google::Cloud::SecretManager::V1::Secret Secret} payload without any - # restrictions. - # @!attribute [rw] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryption] - # Optional. The customer-managed encryption configuration of the - # {::Google::Cloud::SecretManager::V1::Secret Secret}. If no configuration is - # provided, Google-managed default encryption is used. - # - # Updates to the {::Google::Cloud::SecretManager::V1::Secret Secret} encryption - # configuration only apply to - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} added - # afterwards. They do not apply retroactively to existing - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. - class Automatic - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A replication policy that replicates the - # {::Google::Cloud::SecretManager::V1::Secret Secret} payload into the locations - # specified in - # {::Google::Cloud::SecretManager::V1::Replication::UserManaged#replicas Replication.UserManaged.replicas} - # @!attribute [rw] replicas - # @return [::Array<::Google::Cloud::SecretManager::V1::Replication::UserManaged::Replica>] - # Required. The list of Replicas for this - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # - # Cannot be empty. - class UserManaged - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a Replica for this - # {::Google::Cloud::SecretManager::V1::Secret Secret}. - # @!attribute [rw] location - # @return [::String] - # The canonical IDs of the location to replicate data. - # For example: `"us-east1"`. - # @!attribute [rw] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryption] - # Optional. The customer-managed encryption configuration of the - # [User-Managed Replica][Replication.UserManaged.Replica]. If no - # configuration is provided, Google-managed default encryption is used. - # - # Updates to the {::Google::Cloud::SecretManager::V1::Secret Secret} - # encryption configuration only apply to - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} added - # afterwards. They do not apply retroactively to existing - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions}. - class Replica - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Configuration for encrypting secret payloads using customer-managed - # encryption keys (CMEK). - # @!attribute [rw] kms_key_name - # @return [::String] - # Required. The resource name of the Cloud KMS CryptoKey used to encrypt - # secret payloads. - # - # For secrets using the - # {::Google::Cloud::SecretManager::V1::Replication::UserManaged UserManaged} - # replication policy type, Cloud KMS CryptoKeys must reside in the same - # location as the [replica location][Secret.UserManaged.Replica.location]. - # - # For secrets using the - # {::Google::Cloud::SecretManager::V1::Replication::Automatic Automatic} - # replication policy type, Cloud KMS CryptoKeys must reside in `global`. - # - # The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - class CustomerManagedEncryption - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The replication status of a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @!attribute [rw] automatic - # @return [::Google::Cloud::SecretManager::V1::ReplicationStatus::AutomaticStatus] - # Describes the replication status of a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} with - # automatic replication. - # - # Only populated if the parent - # {::Google::Cloud::SecretManager::V1::Secret Secret} has an automatic - # replication policy. - # - # Note: The following fields are mutually exclusive: `automatic`, `user_managed`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] user_managed - # @return [::Google::Cloud::SecretManager::V1::ReplicationStatus::UserManagedStatus] - # Describes the replication status of a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} with - # user-managed replication. - # - # Only populated if the parent - # {::Google::Cloud::SecretManager::V1::Secret Secret} has a user-managed - # replication policy. - # - # Note: The following fields are mutually exclusive: `user_managed`, `automatic`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ReplicationStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The replication status of a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} using - # automatic replication. - # - # Only populated if the parent {::Google::Cloud::SecretManager::V1::Secret Secret} - # has an automatic replication policy. - # @!attribute [r] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryptionStatus] - # Output only. The customer-managed encryption status of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. Only - # populated if customer-managed encryption is used. - class AutomaticStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The replication status of a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} using - # user-managed replication. - # - # Only populated if the parent {::Google::Cloud::SecretManager::V1::Secret Secret} - # has a user-managed replication policy. - # @!attribute [r] replicas - # @return [::Array<::Google::Cloud::SecretManager::V1::ReplicationStatus::UserManagedStatus::ReplicaStatus>] - # Output only. The list of replica statuses for the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - class UserManagedStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes the status of a user-managed replica for the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @!attribute [r] location - # @return [::String] - # Output only. The canonical ID of the replica location. - # For example: `"us-east1"`. - # @!attribute [r] customer_managed_encryption - # @return [::Google::Cloud::SecretManager::V1::CustomerManagedEncryptionStatus] - # Output only. The customer-managed encryption status of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. Only - # populated if customer-managed encryption is used. - class ReplicaStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Describes the status of customer-managed encryption. - # @!attribute [rw] kms_key_version_name - # @return [::String] - # Required. The resource name of the Cloud KMS CryptoKeyVersion used to - # encrypt the secret payload, in the following format: - # `projects/*/locations/*/keyRings/*/cryptoKeys/*/versions/*`. - class CustomerManagedEncryptionStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Pub/Sub topic which Secret Manager will publish to when control plane - # events occur on this secret. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name of the Pub/Sub topic that will be published - # to, in the following format: `projects/*/topics/*`. For publication to - # succeed, the Secret Manager service agent must have the - # `pubsub.topic.publish` permission on the topic. The Pub/Sub Publisher role - # (`roles/pubsub.publisher`) includes this permission. - class Topic - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The rotation time and period for a - # {::Google::Cloud::SecretManager::V1::Secret Secret}. At next_rotation_time, Secret - # Manager will send a Pub/Sub notification to the topics configured on the - # Secret. {::Google::Cloud::SecretManager::V1::Secret#topics Secret.topics} must be - # set to configure rotation. - # @!attribute [rw] next_rotation_time - # @return [::Google::Protobuf::Timestamp] - # Optional. Timestamp in UTC at which the - # {::Google::Cloud::SecretManager::V1::Secret Secret} is scheduled to rotate. - # Cannot be set to less than 300s (5 min) in the future and at most - # 3153600000s (100 years). - # - # {::Google::Cloud::SecretManager::V1::Rotation#next_rotation_time next_rotation_time} - # MUST be set if - # {::Google::Cloud::SecretManager::V1::Rotation#rotation_period rotation_period} - # is set. - # @!attribute [rw] rotation_period - # @return [::Google::Protobuf::Duration] - # Input only. The Duration between rotation notifications. Must be in seconds - # and at least 3600s (1h) and at most 3153600000s (100 years). - # - # If - # {::Google::Cloud::SecretManager::V1::Rotation#rotation_period rotation_period} - # is set, - # {::Google::Cloud::SecretManager::V1::Rotation#next_rotation_time next_rotation_time} - # must be set. - # {::Google::Cloud::SecretManager::V1::Rotation#next_rotation_time next_rotation_time} - # will be advanced by this period when the service automatically sends - # rotation notifications. - # @!attribute [r] managed_rotation_status - # @return [::Google::Cloud::SecretManager::V1::Rotation::ManagedRotationStatus] - # Output only. The current status of the managed rotation. - # This field is only applicable to Typed Secrets. - # This field is set by the service and cannot be set by the user. - class Rotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents the status of a managed rotation. - # - # This is applicable only to Typed Secrets. It indicates whether the - # rotation is active and any errors that may have occurred during the - # asynchronous managed rotation. - # @!attribute [r] state - # @return [::Google::Cloud::SecretManager::V1::Rotation::ManagedRotationStatus::State] - # Output only. Indicates whether the Managed Rotation is active or not. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. Displays customer-facing issues that occurred during an - # asynchronous managed rotation. For example, if there are some permission - # errors. - class ManagedRotationStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # This defines the various states in which the managed rotation can be. - module State - # Not specified. This value is unused and invalid. - STATE_UNSPECIFIED = 0 - - # Indicates that the Managed rotation is ACTIVE. - ACTIVE = 1 - - # Indicates that the Managed rotation is INACTIVE. - INACTIVE = 2 - end - end - end - - # A secret payload resource in the Secret Manager API. This contains the - # sensitive secret payload that is associated with a - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - # @!attribute [rw] data - # @return [::String] - # The secret data. Must be no larger than 64KiB. - # @!attribute [rw] data_crc32c - # @return [::Integer] - # Optional. If specified, - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client SecretManagerService} - # will verify the integrity of the received - # {::Google::Cloud::SecretManager::V1::SecretPayload#data data} on - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion} - # calls using the crc32c checksum and store it to include in future - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion} - # responses. If a checksum is not provided in the - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion} - # request, the - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client SecretManagerService} - # will generate and store one for you. - # - # The CRC32C value is encoded as a Int64 for compatibility, and can be - # safely downconverted to uint32 in languages that support this type. - # https://cloud.google.com/apis/design/design_patterns#integer_types - class SecretPayload - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/service.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/service.rb deleted file mode 100644 index 8066f3be91af..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/cloud/secretmanager/v1/service.rb +++ /dev/null @@ -1,366 +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 SecretManager - module V1 - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets SecretManagerService.ListSecrets}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project associated with the - # {::Google::Cloud::SecretManager::V1::Secret Secrets}, in the format `projects/*` - # or `projects/*/locations/*` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # {::Google::Cloud::SecretManager::V1::ListSecretsResponse#next_page_token ListSecretsResponse.next_page_token}. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secrets matching the filter. If filter is empty, all secrets are - # listed. - class ListSecretsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets SecretManagerService.ListSecrets}. - # @!attribute [rw] secrets - # @return [::Array<::Google::Cloud::SecretManager::V1::Secret>] - # The list of {::Google::Cloud::SecretManager::V1::Secret Secrets} sorted in - # reverse by create_time (newest first). - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Pass this value in - # {::Google::Cloud::SecretManager::V1::ListSecretsRequest#page_token ListSecretsRequest.page_token} - # to retrieve the next page. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of {::Google::Cloud::SecretManager::V1::Secret Secrets} but 0 - # when the - # {::Google::Cloud::SecretManager::V1::ListSecretsRequest#filter ListSecretsRequest.filter} - # field is set. - class ListSecretsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#create_secret SecretManagerService.CreateSecret}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project to associate with the - # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format `projects/*` - # or `projects/*/locations/*`. - # @!attribute [rw] secret_id - # @return [::String] - # Required. This must be unique within the project. - # - # A secret ID is a string with a maximum length of 255 characters and can - # contain uppercase and lowercase letters, numerals, and the hyphen (`-`) and - # underscore (`_`) characters. - # @!attribute [rw] secret - # @return [::Google::Cloud::SecretManager::V1::Secret] - # Required. A {::Google::Cloud::SecretManager::V1::Secret Secret} with initial - # field values. - class CreateSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version SecretManagerService.AddSecretVersion}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @!attribute [rw] payload - # @return [::Google::Cloud::SecretManager::V1::SecretPayload] - # Required. The secret payload of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - class AddSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_managed_rotation SecretManagerService.EnableManagedRotation}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @!attribute [rw] cloud_sql_single_user_credentials - # @return [::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest::CloudSQLSingleUserCredentials] - # Credentials required for Cloud SQL DB for Single user Managed Rotation. - class EnableManagedRotationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # These are the credentials required for Cloud SQL DB for Single user - # Managed Rotation. - # @!attribute [rw] instance_id - # @return [::String] - # Required. Instance ID of the Cloud SQL instance. - # @!attribute [rw] username - # @return [::String] - # Required. Username of the Cloud SQL instance. - # @!attribute [rw] password - # @return [::String] - # Optional. Password of the Cloud SQL instance. If this is not provided, - # a random password will be generated. - class CloudSQLSingleUserCredentials - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#rotate_secret SecretManagerService.RotateSecret}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to associate with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - class RotateSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret SecretManagerService.GetSecret}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret}, in the format - # `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - class GetSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions SecretManagerService.ListSecretVersions}. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} associated with the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} to list, in - # the format `projects/*/secrets/*` or `projects/*/locations/*/secrets/*`. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of results to be returned in a single page. If - # set to 0, the server decides the number of results to return. If the - # number is greater than 25000, it is capped at 25000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. Pagination token, returned earlier via - # ListSecretVersionsResponse.next_page_token][]. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filter string, adhering to the rules in - # [List-operation - # filtering](https://cloud.google.com/secret-manager/docs/filtering). List - # only secret versions matching the filter. If filter is empty, all secret - # versions are listed. - class ListSecretVersionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions SecretManagerService.ListSecretVersions}. - # @!attribute [rw] versions - # @return [::Array<::Google::Cloud::SecretManager::V1::SecretVersion>] - # The list of {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} - # sorted in reverse by create_time (newest first). - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve the next page of results. Pass this value in - # {::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest#page_token ListSecretVersionsRequest.page_token} - # to retrieve the next page. - # @!attribute [rw] total_size - # @return [::Integer] - # The total number of - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersions} but 0 when - # the - # {::Google::Cloud::SecretManager::V1::ListSecretsRequest#filter ListSecretsRequest.filter} - # field is set. - class ListSecretVersionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret_version SecretManagerService.GetSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - class GetSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#update_secret SecretManagerService.UpdateSecret}. - # @!attribute [rw] secret - # @return [::Google::Cloud::SecretManager::V1::Secret] - # Required. {::Google::Cloud::SecretManager::V1::Secret Secret} with updated field - # values. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Specifies the fields to be updated. - class UpdateSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # - # `projects/*/secrets/*/versions/latest` or - # `projects/*/locations/*/secrets/*/versions/latest` is an alias to the most - # recently created - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. - class AccessSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version SecretManagerService.AccessSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} in the format - # `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @!attribute [rw] payload - # @return [::Google::Cloud::SecretManager::V1::SecretPayload] - # Secret payload - class AccessSecretVersionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#delete_secret SecretManagerService.DeleteSecret}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::Secret Secret} to delete in the format - # `projects/*/secrets/*`. - # @!attribute [rw] etag - # @return [::String] - # Optional. Etag of the {::Google::Cloud::SecretManager::V1::Secret Secret}. The - # request succeeds if it matches the etag of the currently stored secret - # object. If the etag is omitted, the request succeeds. - class DeleteSecretRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#disable_secret_version SecretManagerService.DisableSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to disable in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @!attribute [rw] etag - # @return [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - class DisableSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_secret_version SecretManagerService.EnableSecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to enable in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @!attribute [rw] etag - # @return [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - class EnableSecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::SecretManager::V1::SecretManagerService::Client#destroy_secret_version SecretManagerService.DestroySecretVersion}. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion} to destroy in - # the format `projects/*/secrets/*/versions/*` or - # `projects/*/locations/*/secrets/*/versions/*`. - # @!attribute [rw] etag - # @return [::String] - # Optional. Etag of the - # {::Google::Cloud::SecretManager::V1::SecretVersion SecretVersion}. The request - # succeeds if it matches the etag of the currently stored secret version - # object. If the etag is omitted, the request succeeds. - class DestroySecretVersionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-secret_manager-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/Gemfile deleted file mode 100644 index 714e81d5760e..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/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-secret_manager-v1", path: "../" -else - gem "google-cloud-secret_manager-v1" -end - -group :test do - gem "google-style", "~> 1.26.1" - gem "minitest", "~> 5.16" - gem "minitest-focus", "~> 1.1" - gem "minitest-hooks", "~> 1.5" -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb deleted file mode 100644 index dae0739c31ec..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.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 secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the access_secret_version call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#access_secret_version. -# -def access_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new - - # Call the access_secret_version method. - result = client.access_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1::AccessSecretVersionResponse. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb deleted file mode 100644 index 7167e1195230..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.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 secretmanager_v1_generated_SecretManagerService_AddSecretVersion_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the add_secret_version call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#add_secret_version. -# -def add_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new - - # Call the add_secret_version method. - result = client.add_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_AddSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb deleted file mode 100644 index 18e84e0e0cf6..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.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 secretmanager_v1_generated_SecretManagerService_CreateSecret_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the create_secret call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#create_secret. -# -def create_secret - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::CreateSecretRequest.new - - # Call the create_secret method. - result = client.create_secret request - - # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_CreateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb deleted file mode 100644 index d2cda7727281..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.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 secretmanager_v1_generated_SecretManagerService_DeleteSecret_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the delete_secret call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#delete_secret. -# -def delete_secret - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::DeleteSecretRequest.new - - # Call the delete_secret method. - result = client.delete_secret request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_DeleteSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb deleted file mode 100644 index f2a4956d1bfa..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.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 secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the destroy_secret_version call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#destroy_secret_version. -# -def destroy_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new - - # Call the destroy_secret_version method. - result = client.destroy_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb deleted file mode 100644 index 2acddd330453..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.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 secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the disable_secret_version call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#disable_secret_version. -# -def disable_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new - - # Call the disable_secret_version method. - result = client.disable_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb deleted file mode 100644 index 124945e6f241..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.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 secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the enable_secret_version call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#enable_secret_version. -# -def enable_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new - - # Call the enable_secret_version method. - result = client.enable_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb deleted file mode 100644 index 939129c0ed81..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/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 secretmanager_v1_generated_SecretManagerService_GetIamPolicy_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the get_iam_policy call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::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 secretmanager_v1_generated_SecretManagerService_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb deleted file mode 100644 index d63674176991..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.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 secretmanager_v1_generated_SecretManagerService_GetSecret_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the get_secret call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#get_secret. -# -def get_secret - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::GetSecretRequest.new - - # Call the get_secret method. - result = client.get_secret request - - # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_GetSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb deleted file mode 100644 index d784f543ecf2..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.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 secretmanager_v1_generated_SecretManagerService_GetSecretVersion_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the get_secret_version call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#get_secret_version. -# -def get_secret_version - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new - - # Call the get_secret_version method. - result = client.get_secret_version request - - # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_GetSecretVersion_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb deleted file mode 100644 index 1e197877f1eb..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.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 secretmanager_v1_generated_SecretManagerService_ListSecretVersions_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the list_secret_versions call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#list_secret_versions. -# -def list_secret_versions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new - - # Call the list_secret_versions method. - result = client.list_secret_versions 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::SecretManager::V1::SecretVersion. - p item - end -end -# [END secretmanager_v1_generated_SecretManagerService_ListSecretVersions_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb deleted file mode 100644 index 42e277c580e9..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.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 secretmanager_v1_generated_SecretManagerService_ListSecrets_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the list_secrets call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#list_secrets. -# -def list_secrets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::ListSecretsRequest.new - - # Call the list_secrets method. - result = client.list_secrets 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::SecretManager::V1::Secret. - p item - end -end -# [END secretmanager_v1_generated_SecretManagerService_ListSecrets_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb deleted file mode 100644 index 54b76b5acc8c..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/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 secretmanager_v1_generated_SecretManagerService_SetIamPolicy_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the set_iam_policy call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::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 secretmanager_v1_generated_SecretManagerService_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb deleted file mode 100644 index 5b817c93d9c0..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/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 secretmanager_v1_generated_SecretManagerService_TestIamPermissions_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the test_iam_permissions call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::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 secretmanager_v1_generated_SecretManagerService_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb deleted file mode 100644 index c9d6041cca95..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.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 secretmanager_v1_generated_SecretManagerService_UpdateSecret_sync] -require "google/cloud/secret_manager/v1" - -## -# Snippet for the update_secret call in the SecretManagerService 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::SecretManager::V1::SecretManagerService::Client#update_secret. -# -def update_secret - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::SecretManager::V1::UpdateSecretRequest.new - - # Call the update_secret method. - result = client.update_secret request - - # The returned object is of type Google::Cloud::SecretManager::V1::Secret. - p result -end -# [END secretmanager_v1_generated_SecretManagerService_UpdateSecret_sync] diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json b/owl-bot-staging/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json deleted file mode 100644 index 3258c0ed200c..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json +++ /dev/null @@ -1,695 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-secret_manager-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.secretmanager.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_ListSecrets_sync", - "title": "Snippet for the list_secrets call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets.", - "file": "secret_manager_service/list_secrets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_secrets", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::ListSecretsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::ListSecretsResponse", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "ListSecrets", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.ListSecrets", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_CreateSecret_sync", - "title": "Snippet for the create_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#create_secret.", - "file": "secret_manager_service/create_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_secret", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#create_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::CreateSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::Secret", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "CreateSecret", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.CreateSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_AddSecretVersion_sync", - "title": "Snippet for the add_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version.", - "file": "secret_manager_service/add_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "add_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::AddSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "AddSecretVersion", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.AddSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_GetSecret_sync", - "title": "Snippet for the get_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret.", - "file": "secret_manager_service/get_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_secret", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::GetSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::Secret", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "GetSecret", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.GetSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_UpdateSecret_sync", - "title": "Snippet for the update_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#update_secret.", - "file": "secret_manager_service/update_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_secret", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#update_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::UpdateSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::Secret", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "UpdateSecret", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.UpdateSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_DeleteSecret_sync", - "title": "Snippet for the delete_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#delete_secret.", - "file": "secret_manager_service/delete_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_secret", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#delete_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::DeleteSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "DeleteSecret", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.DeleteSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_ListSecretVersions_sync", - "title": "Snippet for the list_secret_versions call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions.", - "file": "secret_manager_service/list_secret_versions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_secret_versions", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "ListSecretVersions", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.ListSecretVersions", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_GetSecretVersion_sync", - "title": "Snippet for the get_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret_version.", - "file": "secret_manager_service/get_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::GetSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "GetSecretVersion", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.GetSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_sync", - "title": "Snippet for the access_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version.", - "file": "secret_manager_service/access_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "access_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "AccessSecretVersion", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.AccessSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_sync", - "title": "Snippet for the disable_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#disable_secret_version.", - "file": "secret_manager_service/disable_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "disable_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#disable_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "DisableSecretVersion", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.DisableSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_sync", - "title": "Snippet for the enable_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_secret_version.", - "file": "secret_manager_service/enable_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "enable_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "EnableSecretVersion", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.EnableSecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_sync", - "title": "Snippet for the destroy_secret_version call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#destroy_secret_version.", - "file": "secret_manager_service/destroy_secret_version.rb", - "language": "RUBY", - "client_method": { - "short_name": "destroy_secret_version", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#destroy_secret_version", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "DestroySecretVersion", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.DestroySecretVersion", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#set_iam_policy.", - "file": "secret_manager_service/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.SetIamPolicy", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_iam_policy.", - "file": "secret_manager_service/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.GetIamPolicy", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#test_iam_permissions.", - "file": "secret_manager_service/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.TestIamPermissions", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_EnableManagedRotation_sync", - "title": "Snippet for the enable_managed_rotation call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_managed_rotation.", - "file": "secret_manager_service/enable_managed_rotation.rb", - "language": "RUBY", - "client_method": { - "short_name": "enable_managed_rotation", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_managed_rotation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "EnableManagedRotation", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.EnableManagedRotation", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "secretmanager_v1_generated_SecretManagerService_RotateSecret_sync", - "title": "Snippet for the rotate_secret call in the SecretManagerService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::SecretManager::V1::SecretManagerService::Client#rotate_secret.", - "file": "secret_manager_service/rotate_secret.rb", - "language": "RUBY", - "client_method": { - "short_name": "rotate_secret", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client#rotate_secret", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::SecretManager::V1::RotateSecretRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::SecretManager::V1::SecretVersion", - "client": { - "short_name": "SecretManagerService::Client", - "full_name": "::Google::Cloud::SecretManager::V1::SecretManagerService::Client" - }, - "method": { - "short_name": "RotateSecret", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService.RotateSecret", - "service": { - "short_name": "SecretManagerService", - "full_name": "google.cloud.secretmanager.v1.SecretManagerService" - } - } - }, - "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-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb deleted file mode 100644 index 7ec6d9553efe..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_paths_test.rb +++ /dev/null @@ -1,109 +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/secret_manager/v1/secret_manager_service" - -class ::Google::Cloud::SecretManager::V1::SecretManagerService::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_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.location_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1", path - end - end - - def test_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_secret_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.secret_path project: "value0", secret: "value1" - assert_equal "projects/value0/secrets/value1", path - - path = client.secret_path project: "value0", location: "value1", secret: "value2" - assert_equal "projects/value0/locations/value1/secrets/value2", path - end - end - - def test_secret_version_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.secret_version_path project: "value0", secret: "value1", secret_version: "value2" - assert_equal "projects/value0/secrets/value1/versions/value2", path - - path = client.secret_version_path project: "value0", location: "value1", secret: "value2", secret_version: "value3" - assert_equal "projects/value0/locations/value1/secrets/value2/versions/value3", path - end - end - - def test_topic_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.topic_path project: "value0", topic: "value1" - assert_equal "projects/value0/topics/value1", path - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb deleted file mode 100644 index b55d10d9aadb..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_rest_test.rb +++ /dev/null @@ -1,1036 +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/cloud/secretmanager/v1/service_pb" -require "google/cloud/secret_manager/v1/secret_manager_service/rest" - - -class ::Google::Cloud::SecretManager::V1::SecretManagerService::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_list_secrets - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::ListSecretsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_secrets_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_list_secrets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_secrets_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_secrets parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_secrets ::Google::Cloud::SecretManager::V1::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.list_secrets(::Google::Cloud::SecretManager::V1::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_secrets_client_stub.call_count - end - end - end - - def test_create_secret - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::Secret.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - secret_id = "hello world" - secret = {} - - create_secret_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_create_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_secret_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.create_secret({ parent: parent, secret_id: secret_id, secret: secret }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.create_secret parent: parent, secret_id: secret_id, secret: secret do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.create_secret ::Google::Cloud::SecretManager::V1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.create_secret({ parent: parent, secret_id: secret_id, secret: secret }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.create_secret(::Google::Cloud::SecretManager::V1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_secret_client_stub.call_count - end - end - end - - def test_add_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - payload = {} - - add_secret_version_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_add_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, add_secret_version_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.add_secret_version({ parent: parent, payload: payload }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.add_secret_version parent: parent, payload: payload do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.add_secret_version ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new(parent: parent, payload: payload) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.add_secret_version({ parent: parent, payload: payload }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.add_secret_version(::Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new(parent: parent, payload: payload), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, add_secret_version_client_stub.call_count - end - end - end - - def test_get_secret - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::Secret.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_secret_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_secret_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_secret({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_secret name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_secret ::Google::Cloud::SecretManager::V1::GetSecretRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_secret({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_secret(::Google::Cloud::SecretManager::V1::GetSecretRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_secret_client_stub.call_count - end - end - end - - def test_update_secret - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::Secret.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - secret = {} - update_mask = {} - - update_secret_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_update_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_secret_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.update_secret({ secret: secret, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.update_secret secret: secret, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.update_secret ::Google::Cloud::SecretManager::V1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.update_secret({ secret: secret, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.update_secret(::Google::Cloud::SecretManager::V1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_secret_client_stub.call_count - end - end - end - - def test_delete_secret - # Create test objects. - client_result = ::Google::Protobuf::Empty.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - delete_secret_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_delete_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_secret_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.delete_secret({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.delete_secret name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.delete_secret ::Google::Cloud::SecretManager::V1::DeleteSecretRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.delete_secret({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.delete_secret(::Google::Cloud::SecretManager::V1::DeleteSecretRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_secret_client_stub.call_count - end - end - end - - def test_list_secret_versions - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - list_secret_versions_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_list_secret_versions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_secret_versions_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.list_secret_versions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.list_secret_versions ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.list_secret_versions(::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_secret_versions_client_stub.call_count - end - end - end - - def test_get_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_secret_version_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_secret_version_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_secret_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_secret_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.get_secret_version ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.get_secret_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.get_secret_version(::Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_secret_version_client_stub.call_count - end - end - end - - def test_access_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - access_secret_version_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_access_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, access_secret_version_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.access_secret_version({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.access_secret_version name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.access_secret_version ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.access_secret_version({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.access_secret_version(::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, access_secret_version_client_stub.call_count - end - end - end - - def test_disable_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - disable_secret_version_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_disable_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, disable_secret_version_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.disable_secret_version({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.disable_secret_version name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.disable_secret_version ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.disable_secret_version({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.disable_secret_version(::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, disable_secret_version_client_stub.call_count - end - end - end - - def test_enable_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - enable_secret_version_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_enable_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, enable_secret_version_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.enable_secret_version({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.enable_secret_version name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.enable_secret_version ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.enable_secret_version({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.enable_secret_version(::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, enable_secret_version_client_stub.call_count - end - end - end - - def test_destroy_secret_version - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - - destroy_secret_version_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_destroy_secret_version_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, destroy_secret_version_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.destroy_secret_version({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.destroy_secret_version name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.destroy_secret_version ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.destroy_secret_version({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.destroy_secret_version(::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, destroy_secret_version_client_stub.call_count - end - end - end - - def test_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.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 - c.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 - c.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::Cloud::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.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 - c.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 - c.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_enable_managed_rotation - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - cloud_sql_single_user_credentials = {} - - enable_managed_rotation_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_enable_managed_rotation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, enable_managed_rotation_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.enable_managed_rotation({ parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.enable_managed_rotation parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.enable_managed_rotation ::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new(parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.enable_managed_rotation({ parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.enable_managed_rotation(::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new(parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, enable_managed_rotation_client_stub.call_count - end - end - end - - def test_rotate_secret - # Create test objects. - client_result = ::Google::Cloud::SecretManager::V1::SecretVersion.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - rotate_secret_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::SecretManager::V1::SecretManagerService::Rest::ServiceStub.stub :transcode_rotate_secret_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, rotate_secret_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - c.rotate_secret({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - c.rotate_secret parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - c.rotate_secret ::Google::Cloud::SecretManager::V1::RotateSecretRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - c.rotate_secret({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - c.rotate_secret(::Google::Cloud::SecretManager::V1::RotateSecretRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, rotate_secret_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::SecretManager::V1::SecretManagerService::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::SecretManager::V1::SecretManagerService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb b/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb deleted file mode 100644 index d36073a4798f..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/test/google/cloud/secret_manager/v1/secret_manager_service_test.rb +++ /dev/null @@ -1,1139 +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/secretmanager/v1/service_pb" -require "google/cloud/secret_manager/v1/secret_manager_service" - -class ::Google::Cloud::SecretManager::V1::SecretManagerService::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_list_secrets - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::ListSecretsResponse.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" - filter = "hello world" - - list_secrets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_secrets, name - assert_kind_of ::Google::Cloud::SecretManager::V1::ListSecretsRequest, 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["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_secrets_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.list_secrets parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.list_secrets ::Google::Cloud::SecretManager::V1::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) 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 - c.list_secrets({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, 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 - c.list_secrets(::Google::Cloud::SecretManager::V1::ListSecretsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), 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_secrets_client_stub.call_rpc_count - end - end - - def test_create_secret - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::Secret.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" - secret_id = "hello world" - secret = {} - - create_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1::CreateSecretRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["secret_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1::Secret), request["secret"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_secret_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.create_secret({ parent: parent, secret_id: secret_id, secret: secret }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.create_secret parent: parent, secret_id: secret_id, secret: secret do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.create_secret ::Google::Cloud::SecretManager::V1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.create_secret({ parent: parent, secret_id: secret_id, secret: secret }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.create_secret(::Google::Cloud::SecretManager::V1::CreateSecretRequest.new(parent: parent, secret_id: secret_id, secret: secret), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_secret_client_stub.call_rpc_count - end - end - - def test_add_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.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" - payload = {} - - add_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :add_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1::SecretPayload), request["payload"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, add_secret_version_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.add_secret_version({ parent: parent, payload: payload }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.add_secret_version parent: parent, payload: payload do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.add_secret_version ::Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new(parent: parent, payload: payload) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.add_secret_version({ parent: parent, payload: payload }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.add_secret_version(::Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new(parent: parent, payload: payload), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, add_secret_version_client_stub.call_rpc_count - end - end - - def test_get_secret - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::Secret.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_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1::GetSecretRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_secret_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_secret({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_secret name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_secret ::Google::Cloud::SecretManager::V1::GetSecretRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_secret({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_secret(::Google::Cloud::SecretManager::V1::GetSecretRequest.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_secret_client_stub.call_rpc_count - end - end - - def test_update_secret - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::Secret.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. - secret = {} - update_mask = {} - - update_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1::UpdateSecretRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1::Secret), request["secret"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_secret_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.update_secret({ secret: secret, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.update_secret secret: secret, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.update_secret ::Google::Cloud::SecretManager::V1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.update_secret({ secret: secret, 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 - c.update_secret(::Google::Cloud::SecretManager::V1::UpdateSecretRequest.new(secret: secret, update_mask: update_mask), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_secret_client_stub.call_rpc_count - end - end - - def test_delete_secret - # 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" - etag = "hello world" - - delete_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1::DeleteSecretRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_secret_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.delete_secret({ name: name, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.delete_secret name: name, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.delete_secret ::Google::Cloud::SecretManager::V1::DeleteSecretRequest.new(name: name, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.delete_secret({ name: name, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.delete_secret(::Google::Cloud::SecretManager::V1::DeleteSecretRequest.new(name: name, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_secret_client_stub.call_rpc_count - end - end - - def test_list_secret_versions - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::ListSecretVersionsResponse.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" - filter = "hello world" - - list_secret_versions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_secret_versions, name - assert_kind_of ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest, 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["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_secret_versions_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.list_secret_versions parent: parent, page_size: page_size, page_token: page_token, filter: filter do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.list_secret_versions ::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter) 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 - c.list_secret_versions({ parent: parent, page_size: page_size, page_token: page_token, filter: filter }, 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 - c.list_secret_versions(::Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter), 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_secret_versions_client_stub.call_rpc_count - end - end - - def test_get_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.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_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_secret_version_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_secret_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_secret_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.get_secret_version ::Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.get_secret_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.get_secret_version(::Google::Cloud::SecretManager::V1::GetSecretVersionRequest.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_secret_version_client_stub.call_rpc_count - end - end - - def test_access_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::AccessSecretVersionResponse.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" - - access_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :access_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, access_secret_version_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.access_secret_version({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.access_secret_version name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.access_secret_version ::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.access_secret_version({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.access_secret_version(::Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.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, access_secret_version_client_stub.call_rpc_count - end - end - - def test_disable_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.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" - etag = "hello world" - - disable_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :disable_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, disable_secret_version_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.disable_secret_version({ name: name, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.disable_secret_version name: name, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.disable_secret_version ::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new(name: name, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.disable_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.disable_secret_version(::Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, disable_secret_version_client_stub.call_rpc_count - end - end - - def test_enable_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.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" - etag = "hello world" - - enable_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :enable_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, enable_secret_version_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.enable_secret_version({ name: name, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.enable_secret_version name: name, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.enable_secret_version ::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new(name: name, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.enable_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.enable_secret_version(::Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, enable_secret_version_client_stub.call_rpc_count - end - end - - def test_destroy_secret_version - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.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" - etag = "hello world" - - destroy_secret_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :destroy_secret_version, name - assert_kind_of ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, destroy_secret_version_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.destroy_secret_version({ name: name, etag: etag }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.destroy_secret_version name: name, etag: etag do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.destroy_secret_version ::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new(name: name, etag: etag) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.destroy_secret_version({ name: name, etag: etag }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.destroy_secret_version(::Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new(name: name, etag: etag), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, destroy_secret_version_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 - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.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 - c.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 - c.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 - c.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 - c.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 - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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 - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.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 - c.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 - c.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_enable_managed_rotation - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.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" - cloud_sql_single_user_credentials = {} - - enable_managed_rotation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :enable_managed_rotation, name - assert_kind_of ::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest::CloudSQLSingleUserCredentials), request["cloud_sql_single_user_credentials"] - assert_equal :cloud_sql_single_user_credentials, request.credentials - refute_nil options - end - - Gapic::ServiceStub.stub :new, enable_managed_rotation_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.enable_managed_rotation({ parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.enable_managed_rotation parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.enable_managed_rotation ::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new(parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.enable_managed_rotation({ parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.enable_managed_rotation(::Google::Cloud::SecretManager::V1::EnableManagedRotationRequest.new(parent: parent, cloud_sql_single_user_credentials: cloud_sql_single_user_credentials), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, enable_managed_rotation_client_stub.call_rpc_count - end - end - - def test_rotate_secret - # Create GRPC objects. - grpc_response = ::Google::Cloud::SecretManager::V1::SecretVersion.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" - - rotate_secret_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :rotate_secret, name - assert_kind_of ::Google::Cloud::SecretManager::V1::RotateSecretRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, rotate_secret_client_stub do - # Create client - c = ::Google::Cloud::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - c.rotate_secret({ parent: parent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - c.rotate_secret parent: parent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - c.rotate_secret ::Google::Cloud::SecretManager::V1::RotateSecretRequest.new(parent: parent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - c.rotate_secret({ parent: parent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - c.rotate_secret(::Google::Cloud::SecretManager::V1::RotateSecretRequest.new(parent: parent), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, rotate_secret_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::SecretManager::V1::SecretManagerService::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::SecretManager::V1::SecretManagerService::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::SecretManager::V1::SecretManagerService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::SecretManager::V1::SecretManagerService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb b/owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-secret_manager-v1/test/helper.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "minitest/autorun" -require "minitest/focus" -require "minitest/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct"