From 100bb40a446f846b65f7476367b1c79b0c6b40e9 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 17 Apr 2026 21:02:48 +0000 Subject: [PATCH 1/2] feat: new iam v3beta client for AccessPolicies, this is step 4&5 for go/client-user-guide?API_NAME=iam.googleapis.com%09&API_SHORTNAME=iam&API_PATH=google%2Fiam&API_VERSION=v3&PROTO_SERVICE=AccessPolicies#run-api-publish-changelist docs: Updated comments across various messages, fields, enums, and methods in the IAM v3beta API, including PolicyBinding, PolicyKind, ListPolicyBindingsRequest, and SearchTargetPolicyBindingsRequest to improve clarity PiperOrigin-RevId: 901360203 Source-Link: https://github.com/googleapis/googleapis/commit/ef576481d03c4c969c0c930cf6998c0176f47015 Source-Link: https://github.com/googleapis/googleapis-gen/commit/472a016b8697cdc7bfacb1bd47273916685ecd40 Copy-Tag: eyJwIjoiZ29vZ2xlLWlhbS12M2JldGEvLk93bEJvdC55YW1sIiwiaCI6IjQ3MmEwMTZiODY5N2NkYzdiZmFjYjFiZDQ3MjczOTE2Njg1ZWNkNDAifQ== --- owl-bot-staging/google-iam-v3beta/.gitignore | 22 + .../google-iam-v3beta/.repo-metadata.json | 17 + .../google-iam-v3beta/.rubocop.yml | 33 + owl-bot-staging/google-iam-v3beta/.toys.rb | 28 + owl-bot-staging/google-iam-v3beta/.yardopts | 12 + .../google-iam-v3beta/AUTHENTICATION.md | 122 ++ .../google-iam-v3beta/CHANGELOG.md | 2 + owl-bot-staging/google-iam-v3beta/Gemfile | 14 + owl-bot-staging/google-iam-v3beta/LICENSE.md | 201 +++ owl-bot-staging/google-iam-v3beta/README.md | 154 +++ owl-bot-staging/google-iam-v3beta/Rakefile | 169 +++ .../google-iam-v3beta/gapic_metadata.json | 126 ++ .../google-cloud-iam-v3beta.gemspec | 29 + .../lib/google-cloud-iam-v3beta.rb | 21 + .../lib/google/cloud/iam/v3beta/version.rb | 28 + .../lib/google/iam/v3beta.rb | 45 + .../lib/google/iam/v3beta/access_policies.rb | 54 + .../iam/v3beta/access_policies/client.rb | 1111 ++++++++++++++++ .../iam/v3beta/access_policies/credentials.rb | 45 + .../iam/v3beta/access_policies/operations.rb | 839 ++++++++++++ .../iam/v3beta/access_policies/paths.rb | 140 ++ .../google/iam/v3beta/access_policies/rest.rb | 51 + .../iam/v3beta/access_policies/rest/client.rb | 1026 +++++++++++++++ .../v3beta/access_policies/rest/operations.rb | 937 +++++++++++++ .../access_policies/rest/service_stub.rb | 535 ++++++++ .../iam/v3beta/access_policies_service_pb.rb | 36 + .../access_policies_service_services_pb.rb | 54 + .../iam/v3beta/access_policy_resources_pb.rb | 29 + .../iam/v3beta/operation_metadata_pb.rb | 22 + .../iam/v3beta/policy_binding_resources_pb.rb | 27 + .../lib/google/iam/v3beta/policy_bindings.rb | 55 + .../iam/v3beta/policy_bindings/client.rb | 1155 +++++++++++++++++ .../iam/v3beta/policy_bindings/credentials.rb | 45 + .../iam/v3beta/policy_bindings/operations.rb | 839 ++++++++++++ .../iam/v3beta/policy_bindings/paths.rb | 140 ++ .../google/iam/v3beta/policy_bindings/rest.rb | 52 + .../iam/v3beta/policy_bindings/rest/client.rb | 1070 +++++++++++++++ .../v3beta/policy_bindings/rest/operations.rb | 937 +++++++++++++ .../policy_bindings/rest/service_stub.rb | 535 ++++++++ .../iam/v3beta/policy_bindings_service_pb.rb | 36 + .../policy_bindings_service_services_pb.rb | 61 + .../principal_access_boundary_policies.rb | 55 + .../client.rb | 1100 ++++++++++++++++ .../credentials.rb | 45 + .../operations.rb | 839 ++++++++++++ .../paths.rb | 67 + .../rest.rb | 52 + .../rest/client.rb | 1015 +++++++++++++++ .../rest/operations.rb | 937 +++++++++++++ .../rest/service_stub.rb | 447 +++++++ ...pal_access_boundary_policies_service_pb.rb | 37 + ...s_boundary_policies_service_services_pb.rb | 56 + ...pal_access_boundary_policy_resources_pb.rb | 27 + .../lib/google/iam/v3beta/rest.rb | 37 + .../google-iam-v3beta/proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 +++++++++ .../proto_docs/google/api/field_behavior.rb | 85 ++ .../proto_docs/google/api/field_info.rb | 88 ++ .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 ++++ .../iam/v3beta/access_policies_service.rb | 203 +++ .../iam/v3beta/access_policy_resources.rb | 223 ++++ .../google/iam/v3beta/operation_metadata.rb | 55 + .../iam/v3beta/policy_binding_resources.rb | 193 +++ .../iam/v3beta/policy_bindings_service.rb | 243 ++++ ...ncipal_access_boundary_policies_service.rb | 191 +++ ...ncipal_access_boundary_policy_resources.rb | 127 ++ .../google/longrunning/operations.rb | 191 +++ .../proto_docs/google/protobuf/any.rb | 145 +++ .../proto_docs/google/protobuf/duration.rb | 98 ++ .../proto_docs/google/protobuf/empty.rb | 34 + .../proto_docs/google/protobuf/field_mask.rb | 229 ++++ .../proto_docs/google/protobuf/timestamp.rb | 127 ++ .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 ++ .../google-iam-v3beta/snippets/Gemfile | 32 + .../access_policies/create_access_policy.rb | 54 + .../access_policies/delete_access_policy.rb | 54 + .../access_policies/get_access_policy.rb | 47 + .../access_policies/list_access_policies.rb | 51 + .../search_access_policy_bindings.rb | 51 + .../access_policies/update_access_policy.rb | 54 + .../policy_bindings/create_policy_binding.rb | 54 + .../policy_bindings/delete_policy_binding.rb | 54 + .../policy_bindings/get_policy_binding.rb | 47 + .../policy_bindings/list_policy_bindings.rb | 51 + .../search_target_policy_bindings.rb | 51 + .../policy_bindings/update_policy_binding.rb | 54 + ...create_principal_access_boundary_policy.rb | 54 + ...delete_principal_access_boundary_policy.rb | 54 + .../get_principal_access_boundary_policy.rb | 47 + ...list_principal_access_boundary_policies.rb | 51 + ...incipal_access_boundary_policy_bindings.rb | 51 + ...update_principal_access_boundary_policy.rb | 54 + .../snippet_metadata_google.iam.v3beta.json | 735 +++++++++++ .../v3beta/access_policies_operations_test.rb | 400 ++++++ .../iam/v3beta/access_policies_paths_test.rb | 97 ++ .../iam/v3beta/access_policies_rest_test.rb | 434 +++++++ .../google/iam/v3beta/access_policies_test.rb | 513 ++++++++ .../v3beta/policy_bindings_operations_test.rb | 400 ++++++ .../iam/v3beta/policy_bindings_paths_test.rb | 97 ++ .../iam/v3beta/policy_bindings_rest_test.rb | 437 +++++++ .../google/iam/v3beta/policy_bindings_test.rb | 519 ++++++++ ...ccess_boundary_policies_operations_test.rb | 400 ++++++ ...pal_access_boundary_policies_paths_test.rb | 67 + ...ipal_access_boundary_policies_rest_test.rb | 435 +++++++ ...principal_access_boundary_policies_test.rb | 515 ++++++++ .../google-iam-v3beta/test/helper.rb | 26 + 108 files changed, 24858 insertions(+) create mode 100644 owl-bot-staging/google-iam-v3beta/.gitignore create mode 100644 owl-bot-staging/google-iam-v3beta/.repo-metadata.json create mode 100644 owl-bot-staging/google-iam-v3beta/.rubocop.yml create mode 100644 owl-bot-staging/google-iam-v3beta/.toys.rb create mode 100644 owl-bot-staging/google-iam-v3beta/.yardopts create mode 100644 owl-bot-staging/google-iam-v3beta/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-iam-v3beta/CHANGELOG.md create mode 100644 owl-bot-staging/google-iam-v3beta/Gemfile create mode 100644 owl-bot-staging/google-iam-v3beta/LICENSE.md create mode 100644 owl-bot-staging/google-iam-v3beta/README.md create mode 100644 owl-bot-staging/google-iam-v3beta/Rakefile create mode 100644 owl-bot-staging/google-iam-v3beta/gapic_metadata.json create mode 100644 owl-bot-staging/google-iam-v3beta/google-cloud-iam-v3beta.gemspec create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google-cloud-iam-v3beta.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/cloud/iam/v3beta/version.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/client.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/credentials.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/operations.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/paths.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/client.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/operations.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/service_stub.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies_service_pb.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies_service_services_pb.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policy_resources_pb.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/operation_metadata_pb.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_binding_resources_pb.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/client.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/credentials.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/operations.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/paths.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/client.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/operations.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/service_stub.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_pb.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_services_pb.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/client.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/credentials.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/operations.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/paths.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/client.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/operations.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/service_stub.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies_service_pb.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies_service_services_pb.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policy_resources_pb.rb create mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/rest.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/README.md create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/access_policies_service.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/access_policy_resources.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/operation_metadata.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_binding_resources.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_bindings_service.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/principal_access_boundary_policies_service.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/principal_access_boundary_policy_resources.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/Gemfile create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/access_policies/create_access_policy.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/access_policies/delete_access_policy.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/access_policies/get_access_policy.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/access_policies/list_access_policies.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/access_policies/search_access_policy_bindings.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/access_policies/update_access_policy.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/create_policy_binding.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/delete_policy_binding.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/get_policy_binding.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/list_policy_bindings.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/search_target_policy_bindings.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/update_policy_binding.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/create_principal_access_boundary_policy.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/delete_principal_access_boundary_policy.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/get_principal_access_boundary_policy.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/list_principal_access_boundary_policies.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/search_principal_access_boundary_policy_bindings.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/update_principal_access_boundary_policy.rb create mode 100644 owl-bot-staging/google-iam-v3beta/snippets/snippet_metadata_google.iam.v3beta.json create mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_operations_test.rb create mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_paths_test.rb create mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_rest_test.rb create mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_test.rb create mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_operations_test.rb create mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_paths_test.rb create mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_rest_test.rb create mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_test.rb create mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_operations_test.rb create mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_paths_test.rb create mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_rest_test.rb create mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_test.rb create mode 100644 owl-bot-staging/google-iam-v3beta/test/helper.rb diff --git a/owl-bot-staging/google-iam-v3beta/.gitignore b/owl-bot-staging/google-iam-v3beta/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/.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-iam-v3beta/.repo-metadata.json b/owl-bot-staging/google-iam-v3beta/.repo-metadata.json new file mode 100644 index 000000000000..b550bb371a13 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "iam.googleapis.com", + "api_shortname": "iam", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-iam-v3beta/latest", + "distribution_name": "google-cloud-iam-v3beta", + "is_cloud": true, + "language": "ruby", + "name": "iam", + "name_pretty": "Identity and Access Management (IAM) V3BETA API", + "product_documentation": "https://cloud.google.com/iam/docs/overview", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API. Note that google-cloud-iam-v3beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-iam instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/iam/docs/overview", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-iam-v3beta/.rubocop.yml b/owl-bot-staging/google-iam-v3beta/.rubocop.yml new file mode 100644 index 000000000000..efbd005346b3 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-iam-v3beta.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-iam-v3beta.rb" diff --git a/owl-bot-staging/google-iam-v3beta/.toys.rb b/owl-bot-staging/google-iam-v3beta/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/.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-iam-v3beta/.yardopts b/owl-bot-staging/google-iam-v3beta/.yardopts new file mode 100644 index 000000000000..10df2b7003ed --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Identity and Access Management (IAM) V3BETA 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-iam-v3beta/AUTHENTICATION.md b/owl-bot-staging/google-iam-v3beta/AUTHENTICATION.md new file mode 100644 index 000000000000..ff7654b6751d --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-iam-v3beta 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-iam-v3beta 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/iam/v3beta" + +client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/iam/v3beta" + +::Google::Iam::V3beta::AccessPolicies::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Iam::V3beta::AccessPolicies::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-iam-v3beta +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/iam/v3beta" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Iam::V3beta::AccessPolicies::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-iam-v3beta/CHANGELOG.md b/owl-bot-staging/google-iam-v3beta/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-iam-v3beta/Gemfile b/owl-bot-staging/google-iam-v3beta/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/LICENSE.md b/owl-bot-staging/google-iam-v3beta/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/README.md b/owl-bot-staging/google-iam-v3beta/README.md new file mode 100644 index 000000000000..f708122c6c3a --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Identity and Access Management (IAM) V3BETA API + +Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API. + +Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Identity and Access Management (IAM) V3BETA API. Most users should consider using +the main client gem, +[google-cloud-iam](https://rubygems.org/gems/google-cloud-iam). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-iam-v3beta +``` + +## 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/iam.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/iam/v3beta" + +client = ::Google::Iam::V3beta::AccessPolicies::Client.new +request = ::Google::Iam::V3beta::CreateAccessPolicyRequest.new # (request fields as keyword arguments...) +response = client.create_access_policy request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-iam-v3beta/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/iam/docs/overview) +for general usage information. + +## Debug Logging + +This library comes with opt-in Debug Logging that can help you troubleshoot +your application's integration with the API. When logging is activated, key +events such as requests and responses, along with data payloads and metadata +such as headers and client configuration, are logged to the standard error +stream. + +**WARNING:** Client Library Debug Logging includes your data payloads in +plaintext, which could include sensitive data such as PII for yourself or your +customers, private keys, or other security data that could be compromising if +leaked. Always practice good data hygiene with your application logs, and follow +the principle of least access. Google also recommends that Client Library Debug +Logging be enabled only temporarily during active debugging, and not used +permanently in production. + +To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` +to the value `all`. Alternatively, you can set the value to a comma-delimited +list of client library gem names. This will select the default logging behavior, +which writes logs to the standard error stream. On a local workstation, this may +result in logs appearing on the console. When running on a Google Cloud hosting +service such as [Google Cloud Run](https://cloud.google.com/run), this generally +results in logs appearing alongside your application logs in the +[Google Cloud Logging](https://cloud.google.com/logging/) service. + +You can customize logging by modifying the `logger` configuration when +constructing a client object. For example: + +```ruby +require "google/iam/v3beta" +require "logger" + +client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + config.logger = Logger.new "my-app.log" +end +``` + +## Google Cloud Samples + +To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). + +## Supported Ruby Versions + +This library is supported on Ruby 3.0+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-iam`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-iam-v3beta`. +_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-iam`. +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-iam-v3beta`. + +### 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-iam-v3beta/Rakefile b/owl-bot-staging/google-iam-v3beta/Rakefile new file mode 100644 index 000000000000..4784cc7f73f9 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/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-iam-v3beta acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/iam/v3beta/access_policies/credentials" + ::Google::Iam::V3beta::AccessPolicies::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-iam-v3beta 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-iam-v3beta 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-iam-v3beta 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-iam-v3beta gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-iam-v3beta" + header "google-cloud-iam-v3beta rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-iam-v3beta yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-iam-v3beta 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-iam-v3beta 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-iam-v3beta 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-iam-v3beta/gapic_metadata.json b/owl-bot-staging/google-iam-v3beta/gapic_metadata.json new file mode 100644 index 000000000000..13391b62f322 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/gapic_metadata.json @@ -0,0 +1,126 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.iam.v3beta", + "libraryPackage": "::Google::Iam::V3beta", + "services": { + "AccessPolicies": { + "clients": { + "grpc": { + "libraryClient": "::Google::Iam::V3beta::AccessPolicies::Client", + "rpcs": { + "CreateAccessPolicy": { + "methods": [ + "create_access_policy" + ] + }, + "GetAccessPolicy": { + "methods": [ + "get_access_policy" + ] + }, + "UpdateAccessPolicy": { + "methods": [ + "update_access_policy" + ] + }, + "DeleteAccessPolicy": { + "methods": [ + "delete_access_policy" + ] + }, + "ListAccessPolicies": { + "methods": [ + "list_access_policies" + ] + }, + "SearchAccessPolicyBindings": { + "methods": [ + "search_access_policy_bindings" + ] + } + } + } + } + }, + "PolicyBindings": { + "clients": { + "grpc": { + "libraryClient": "::Google::Iam::V3beta::PolicyBindings::Client", + "rpcs": { + "CreatePolicyBinding": { + "methods": [ + "create_policy_binding" + ] + }, + "GetPolicyBinding": { + "methods": [ + "get_policy_binding" + ] + }, + "UpdatePolicyBinding": { + "methods": [ + "update_policy_binding" + ] + }, + "DeletePolicyBinding": { + "methods": [ + "delete_policy_binding" + ] + }, + "ListPolicyBindings": { + "methods": [ + "list_policy_bindings" + ] + }, + "SearchTargetPolicyBindings": { + "methods": [ + "search_target_policy_bindings" + ] + } + } + } + } + }, + "PrincipalAccessBoundaryPolicies": { + "clients": { + "grpc": { + "libraryClient": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client", + "rpcs": { + "CreatePrincipalAccessBoundaryPolicy": { + "methods": [ + "create_principal_access_boundary_policy" + ] + }, + "GetPrincipalAccessBoundaryPolicy": { + "methods": [ + "get_principal_access_boundary_policy" + ] + }, + "UpdatePrincipalAccessBoundaryPolicy": { + "methods": [ + "update_principal_access_boundary_policy" + ] + }, + "DeletePrincipalAccessBoundaryPolicy": { + "methods": [ + "delete_principal_access_boundary_policy" + ] + }, + "ListPrincipalAccessBoundaryPolicies": { + "methods": [ + "list_principal_access_boundary_policies" + ] + }, + "SearchPrincipalAccessBoundaryPolicyBindings": { + "methods": [ + "search_principal_access_boundary_policy_bindings" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-iam-v3beta/google-cloud-iam-v3beta.gemspec b/owl-bot-staging/google-iam-v3beta/google-cloud-iam-v3beta.gemspec new file mode 100644 index 000000000000..044d5a00e43b --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/google-cloud-iam-v3beta.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/iam/v3beta/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-iam-v3beta" + gem.version = Google::Cloud::Iam::V3beta::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API. Note that google-cloud-iam-v3beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-iam instead. See the readme for more details." + gem.summary = "Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API." + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + `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.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google-cloud-iam-v3beta.rb b/owl-bot-staging/google-iam-v3beta/lib/google-cloud-iam-v3beta.rb new file mode 100644 index 000000000000..462c76ed1789 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google-cloud-iam-v3beta.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/iam/v3beta" diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/cloud/iam/v3beta/version.rb b/owl-bot-staging/google-iam-v3beta/lib/google/cloud/iam/v3beta/version.rb new file mode 100644 index 000000000000..55a2615baf4d --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/cloud/iam/v3beta/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 Iam + module V3beta + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta.rb new file mode 100644 index 000000000000..30ca95741887 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta.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/iam/v3beta/access_policies" +require "google/iam/v3beta/policy_bindings" +require "google/iam/v3beta/principal_access_boundary_policies" +require "google/cloud/iam/v3beta/version" + +module Google + module Iam + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/iam/v3beta" + # client = ::Google::Iam::V3beta::AccessPolicies::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/iam/v3beta" + # client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new + # + module V3beta + end + end +end + +helper_path = ::File.join __dir__, "v3beta", "_helpers.rb" +require "google/iam/v3beta/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies.rb new file mode 100644 index 000000000000..e3d3fbdca4e0 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/iam/v3beta/version" + +require "google/iam/v3beta/access_policies/credentials" +require "google/iam/v3beta/access_policies/paths" +require "google/iam/v3beta/access_policies/operations" +require "google/iam/v3beta/access_policies/client" +require "google/iam/v3beta/access_policies/rest" + +module Google + module Iam + module V3beta + ## + # Manages Identity and Access Management (IAM) access policies. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/iam/v3beta/access_policies" + # client = ::Google::Iam::V3beta::AccessPolicies::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/iam/v3beta/access_policies/rest" + # client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new + # + module AccessPolicies + end + end + end +end + +helper_path = ::File.join __dir__, "access_policies", "helpers.rb" +require "google/iam/v3beta/access_policies/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/client.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/client.rb new file mode 100644 index 000000000000..bb1f972cbbee --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/client.rb @@ -0,0 +1,1111 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/iam/v3beta/access_policies_service_pb" +require "google/cloud/location" + +module Google + module Iam + module V3beta + module AccessPolicies + ## + # Client for the AccessPolicies service. + # + # Manages Identity and Access Management (IAM) access policies. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :access_policies_stub + + ## + # Configure the AccessPolicies Client class. + # + # See {::Google::Iam::V3beta::AccessPolicies::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AccessPolicies clients + # ::Google::Iam::V3beta::AccessPolicies::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Iam", "V3beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_access_policy.timeout = 30.0 + + default_config.rpcs.get_access_policy.timeout = 60.0 + default_config.rpcs.get_access_policy.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_access_policy.timeout = 30.0 + + default_config.rpcs.delete_access_policy.timeout = 30.0 + + default_config.rpcs.list_access_policies.timeout = 60.0 + default_config.rpcs.list_access_policies.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_access_policy_bindings.timeout = 60.0 + default_config.rpcs.search_access_policy_bindings.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AccessPolicies Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Iam::V3beta::AccessPolicies::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 + @access_policies_stub.universe_domain + end + + ## + # Create a new AccessPolicies client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Iam::V3beta::AccessPolicies::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AccessPolicies client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/iam/v3beta/access_policies_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 + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @access_policies_stub = ::Gapic::ServiceStub.new( + ::Google::Iam::V3beta::AccessPolicies::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 + ) + + @access_policies_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 = @access_policies_stub.endpoint + config.universe_domain = @access_policies_stub.universe_domain + config.logger = @access_policies_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Iam::V3beta::AccessPolicies::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @access_policies_stub.logger + end + + # Service calls + + ## + # Creates an access policy, and returns a long running operation. + # + # @overload create_access_policy(request, options = nil) + # Pass arguments to `create_access_policy` via a request object, either of type + # {::Google::Iam::V3beta::CreateAccessPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::CreateAccessPolicyRequest, ::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_access_policy(parent: nil, access_policy_id: nil, access_policy: nil, validate_only: nil) + # Pass arguments to `create_access_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 parent [::String] + # Required. The parent resource where this access policy will be created. + # + # Format: + # `projects/{project_id}/locations/{location}` + # `projects/{project_number}/locations/{location}` + # `folders/{folder_id}/locations/{location}` + # `organizations/{organization_id}/locations/{location}` + # @param access_policy_id [::String] + # Required. The ID to use for the access policy, which + # will become the final component of the access policy's + # resource name. + # + # This value must start with a lowercase letter followed by up to 62 + # lowercase letters, numbers, hyphens, or dots. Pattern, + # /[a-z][a-z0-9-\.]\\{2,62}/. + # + # This value must be unique among all access policies with the same parent. + # @param access_policy [::Google::Iam::V3beta::AccessPolicy, ::Hash] + # Required. The access policy to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the creation, but do not + # actually post it. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::AccessPolicies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::CreateAccessPolicyRequest.new + # + # # Call the create_access_policy method. + # result = client.create_access_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_access_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::CreateAccessPolicyRequest + + # 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_access_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::Iam::V3beta::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_access_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_access_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @access_policies_stub.call_rpc :create_access_policy, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets an access policy. + # + # @overload get_access_policy(request, options = nil) + # Pass arguments to `get_access_policy` via a request object, either of type + # {::Google::Iam::V3beta::GetAccessPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::GetAccessPolicyRequest, ::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_access_policy(name: nil) + # Pass arguments to `get_access_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 name [::String] + # Required. The name of the access policy to retrieve. + # + # Format: + # `projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}` + # `folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V3beta::AccessPolicy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V3beta::AccessPolicy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::AccessPolicies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::GetAccessPolicyRequest.new + # + # # Call the get_access_policy method. + # result = client.get_access_policy request + # + # # The returned object is of type Google::Iam::V3beta::AccessPolicy. + # p result + # + def get_access_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::GetAccessPolicyRequest + + # 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_access_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::Iam::V3beta::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_access_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_access_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @access_policies_stub.call_rpc :get_access_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates an access policy. + # + # @overload update_access_policy(request, options = nil) + # Pass arguments to `update_access_policy` via a request object, either of type + # {::Google::Iam::V3beta::UpdateAccessPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::UpdateAccessPolicyRequest, ::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_access_policy(access_policy: nil, validate_only: nil) + # Pass arguments to `update_access_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 access_policy [::Google::Iam::V3beta::AccessPolicy, ::Hash] + # Required. The access policy to update. + # + # The access policy's `name` field is used to identify the + # policy to update. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the update, but do not + # actually post it. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::AccessPolicies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::UpdateAccessPolicyRequest.new + # + # # Call the update_access_policy method. + # result = client.update_access_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_access_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::UpdateAccessPolicyRequest + + # 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_access_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::Iam::V3beta::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.access_policy&.name + header_params["access_policy.name"] = request.access_policy.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_access_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_access_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @access_policies_stub.call_rpc :update_access_policy, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an access policy. + # + # @overload delete_access_policy(request, options = nil) + # Pass arguments to `delete_access_policy` via a request object, either of type + # {::Google::Iam::V3beta::DeleteAccessPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::DeleteAccessPolicyRequest, ::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_access_policy(name: nil, etag: nil, validate_only: nil, force: nil) + # Pass arguments to `delete_access_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 name [::String] + # Required. The name of the access policy to delete. + # + # Format: + # `projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}` + # `folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}` + # @param etag [::String] + # Optional. The etag of the access policy. If this is provided, it must match + # the server's etag. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the deletion, but do not + # actually post it. + # @param force [::Boolean] + # Optional. If set to true, the request will force the deletion of the Policy + # even if the Policy references PolicyBindings. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::AccessPolicies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::DeleteAccessPolicyRequest.new + # + # # Call the delete_access_policy method. + # result = client.delete_access_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_access_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::DeleteAccessPolicyRequest + + # 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_access_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::Iam::V3beta::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_access_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_access_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @access_policies_stub.call_rpc :delete_access_policy, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists access policies. + # + # @overload list_access_policies(request, options = nil) + # Pass arguments to `list_access_policies` via a request object, either of type + # {::Google::Iam::V3beta::ListAccessPoliciesRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::ListAccessPoliciesRequest, ::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_access_policies(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_access_policies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource, which owns the collection of access policy + # resources. + # + # Format: + # `projects/{project_id}/locations/{location}` + # `projects/{project_number}/locations/{location}` + # `folders/{folder_id}/locations/{location}` + # `organizations/{organization_id}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of access policies to return. The + # service may return fewer than this value. + # + # If unspecified, at most 50 access policies will be returned. Valid value + # ranges from 1 to 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `ListAccessPolicies` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `ListAccessPolicies` must match the call that provided the + # page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V3beta::AccessPolicy>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Iam::V3beta::AccessPolicy>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::AccessPolicies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::ListAccessPoliciesRequest.new + # + # # Call the list_access_policies method. + # result = client.list_access_policies 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::Iam::V3beta::AccessPolicy. + # p item + # end + # + def list_access_policies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::ListAccessPoliciesRequest + + # 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_access_policies.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::Iam::V3beta::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_access_policies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_access_policies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @access_policies_stub.call_rpc :list_access_policies, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @access_policies_stub, :list_access_policies, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns all policy bindings that bind a specific policy if a user has + # searchPolicyBindings permission on that policy. + # + # @overload search_access_policy_bindings(request, options = nil) + # Pass arguments to `search_access_policy_bindings` via a request object, either of type + # {::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest, ::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 search_access_policy_bindings(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_access_policy_bindings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the access policy. + # Format: + # `organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}` + # @param page_size [::Integer] + # Optional. The maximum number of policy bindings to return. The service may + # return fewer than this value. + # + # If unspecified, at most 50 policy bindings will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `SearchAccessPolicyBindingsRequest` call. Provide this to + # retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `SearchAccessPolicyBindingsRequest` must match the call + # that provided the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::AccessPolicies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::SearchAccessPolicyBindingsRequest.new + # + # # Call the search_access_policy_bindings method. + # result = client.search_access_policy_bindings 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::Iam::V3beta::PolicyBinding. + # p item + # end + # + def search_access_policy_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest + + # 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.search_access_policy_bindings.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::Iam::V3beta::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.search_access_policy_bindings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_access_policy_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @access_policies_stub.call_rpc :search_access_policy_bindings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @access_policies_stub, :search_access_policy_bindings, 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 + + ## + # Configuration class for the AccessPolicies API. + # + # This class represents the configuration for AccessPolicies, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Iam::V3beta::AccessPolicies::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_access_policy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::V3beta::AccessPolicies::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_access_policy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_access_policy.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "iam.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 AccessPolicies API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_access_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :create_access_policy + ## + # RPC-specific configuration for `get_access_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_access_policy + ## + # RPC-specific configuration for `update_access_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :update_access_policy + ## + # RPC-specific configuration for `delete_access_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_access_policy + ## + # RPC-specific configuration for `list_access_policies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_access_policies + ## + # RPC-specific configuration for `search_access_policy_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :search_access_policy_bindings + + # @private + def initialize parent_rpcs = nil + create_access_policy_config = parent_rpcs.create_access_policy if parent_rpcs.respond_to? :create_access_policy + @create_access_policy = ::Gapic::Config::Method.new create_access_policy_config + get_access_policy_config = parent_rpcs.get_access_policy if parent_rpcs.respond_to? :get_access_policy + @get_access_policy = ::Gapic::Config::Method.new get_access_policy_config + update_access_policy_config = parent_rpcs.update_access_policy if parent_rpcs.respond_to? :update_access_policy + @update_access_policy = ::Gapic::Config::Method.new update_access_policy_config + delete_access_policy_config = parent_rpcs.delete_access_policy if parent_rpcs.respond_to? :delete_access_policy + @delete_access_policy = ::Gapic::Config::Method.new delete_access_policy_config + list_access_policies_config = parent_rpcs.list_access_policies if parent_rpcs.respond_to? :list_access_policies + @list_access_policies = ::Gapic::Config::Method.new list_access_policies_config + search_access_policy_bindings_config = parent_rpcs.search_access_policy_bindings if parent_rpcs.respond_to? :search_access_policy_bindings + @search_access_policy_bindings = ::Gapic::Config::Method.new search_access_policy_bindings_config + + yield self if block_given? + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/credentials.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/credentials.rb new file mode 100644 index 000000000000..c1cd49c60577 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/credentials.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 "googleauth" + +module Google + module Iam + module V3beta + module AccessPolicies + # Credentials for the AccessPolicies API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/operations.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/operations.rb new file mode 100644 index 000000000000..1aca758a03d0 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/operations.rb @@ -0,0 +1,839 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Iam + module V3beta + module AccessPolicies + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the AccessPolicies Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the AccessPolicies Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "iam.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/paths.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/paths.rb new file mode 100644 index 000000000000..84aeb6908123 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/paths.rb @@ -0,0 +1,140 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 V3beta + module AccessPolicies + # Path helper methods for the AccessPolicies API. + module Paths + ## + # Create a fully-qualified AccessPolicy resource string. + # + # @overload access_policy_path(organization:, location:, access_policy:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/accessPolicies/{access_policy}` + # + # @param organization [String] + # @param location [String] + # @param access_policy [String] + # + # @overload access_policy_path(folder:, location:, access_policy:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/accessPolicies/{access_policy}` + # + # @param folder [String] + # @param location [String] + # @param access_policy [String] + # + # @overload access_policy_path(project:, location:, access_policy:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/accessPolicies/{access_policy}` + # + # @param project [String] + # @param location [String] + # @param access_policy [String] + # + # @return [::String] + def access_policy_path **args + resources = { + "access_policy:location:organization" => (proc do |organization:, location:, access_policy:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/accessPolicies/#{access_policy}" + end), + "access_policy:folder:location" => (proc do |folder:, location:, access_policy:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/accessPolicies/#{access_policy}" + end), + "access_policy:location:project" => (proc do |project:, location:, access_policy:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/accessPolicies/#{access_policy}" + 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 FolderLocation resource string. + # + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}` + # + # @param folder [String] + # @param location [String] + # + # @return [::String] + def folder_location_path folder:, location: + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/locations/#{location}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified OrganizationLocation resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}` + # + # @param organization [String] + # @param location [String] + # + # @return [::String] + def organization_location_path organization:, location: + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}" + end + + extend self + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest.rb new file mode 100644 index 000000000000..51742f0ec501 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest.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 "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/iam/v3beta/version" + +require "google/iam/v3beta/access_policies/credentials" +require "google/iam/v3beta/access_policies/paths" +require "google/iam/v3beta/access_policies/rest/operations" +require "google/iam/v3beta/access_policies/rest/client" + +module Google + module Iam + module V3beta + ## + # Manages Identity and Access Management (IAM) access policies. + # + # To load this service and instantiate a REST client: + # + # require "google/iam/v3beta/access_policies/rest" + # client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new + # + module AccessPolicies + # Client for the REST transport + module Rest + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/iam/v3beta/access_policies/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/client.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/client.rb new file mode 100644 index 000000000000..fbc4603967a1 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/client.rb @@ -0,0 +1,1026 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/iam/v3beta/access_policies_service_pb" +require "google/iam/v3beta/access_policies/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Iam + module V3beta + module AccessPolicies + module Rest + ## + # REST client for the AccessPolicies service. + # + # Manages Identity and Access Management (IAM) access policies. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :access_policies_stub + + ## + # Configure the AccessPolicies Client class. + # + # See {::Google::Iam::V3beta::AccessPolicies::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AccessPolicies clients + # ::Google::Iam::V3beta::AccessPolicies::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Iam", "V3beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_access_policy.timeout = 30.0 + + default_config.rpcs.get_access_policy.timeout = 60.0 + default_config.rpcs.get_access_policy.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_access_policy.timeout = 30.0 + + default_config.rpcs.delete_access_policy.timeout = 30.0 + + default_config.rpcs.list_access_policies.timeout = 60.0 + default_config.rpcs.list_access_policies.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_access_policy_bindings.timeout = 60.0 + default_config.rpcs.search_access_policy_bindings.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AccessPolicies Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Iam::V3beta::AccessPolicies::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 + @access_policies_stub.universe_domain + end + + ## + # Create a new AccessPolicies REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AccessPolicies client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Iam::V3beta::AccessPolicies::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @access_policies_stub = ::Google::Iam::V3beta::AccessPolicies::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @access_policies_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 = @access_policies_stub.endpoint + config.universe_domain = @access_policies_stub.universe_domain + config.logger = @access_policies_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Iam::V3beta::AccessPolicies::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @access_policies_stub.logger + end + + # Service calls + + ## + # Creates an access policy, and returns a long running operation. + # + # @overload create_access_policy(request, options = nil) + # Pass arguments to `create_access_policy` via a request object, either of type + # {::Google::Iam::V3beta::CreateAccessPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::CreateAccessPolicyRequest, ::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_access_policy(parent: nil, access_policy_id: nil, access_policy: nil, validate_only: nil) + # Pass arguments to `create_access_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 parent [::String] + # Required. The parent resource where this access policy will be created. + # + # Format: + # `projects/{project_id}/locations/{location}` + # `projects/{project_number}/locations/{location}` + # `folders/{folder_id}/locations/{location}` + # `organizations/{organization_id}/locations/{location}` + # @param access_policy_id [::String] + # Required. The ID to use for the access policy, which + # will become the final component of the access policy's + # resource name. + # + # This value must start with a lowercase letter followed by up to 62 + # lowercase letters, numbers, hyphens, or dots. Pattern, + # /[a-z][a-z0-9-\.]\\{2,62}/. + # + # This value must be unique among all access policies with the same parent. + # @param access_policy [::Google::Iam::V3beta::AccessPolicy, ::Hash] + # Required. The access policy to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the creation, but do not + # actually post it. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::AccessPolicies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::CreateAccessPolicyRequest.new + # + # # Call the create_access_policy method. + # result = client.create_access_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_access_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::CreateAccessPolicyRequest + + # 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_access_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::Iam::V3beta::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_access_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_access_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @access_policies_stub.create_access_policy request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 an access policy. + # + # @overload get_access_policy(request, options = nil) + # Pass arguments to `get_access_policy` via a request object, either of type + # {::Google::Iam::V3beta::GetAccessPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::GetAccessPolicyRequest, ::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_access_policy(name: nil) + # Pass arguments to `get_access_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 name [::String] + # Required. The name of the access policy to retrieve. + # + # Format: + # `projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}` + # `folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V3beta::AccessPolicy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V3beta::AccessPolicy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::AccessPolicies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::GetAccessPolicyRequest.new + # + # # Call the get_access_policy method. + # result = client.get_access_policy request + # + # # The returned object is of type Google::Iam::V3beta::AccessPolicy. + # p result + # + def get_access_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::GetAccessPolicyRequest + + # 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_access_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::Iam::V3beta::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_access_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_access_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @access_policies_stub.get_access_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 + + ## + # Updates an access policy. + # + # @overload update_access_policy(request, options = nil) + # Pass arguments to `update_access_policy` via a request object, either of type + # {::Google::Iam::V3beta::UpdateAccessPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::UpdateAccessPolicyRequest, ::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_access_policy(access_policy: nil, validate_only: nil) + # Pass arguments to `update_access_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 access_policy [::Google::Iam::V3beta::AccessPolicy, ::Hash] + # Required. The access policy to update. + # + # The access policy's `name` field is used to identify the + # policy to update. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the update, but do not + # actually post it. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::AccessPolicies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::UpdateAccessPolicyRequest.new + # + # # Call the update_access_policy method. + # result = client.update_access_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_access_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::UpdateAccessPolicyRequest + + # 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_access_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::Iam::V3beta::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_access_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_access_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @access_policies_stub.update_access_policy request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an access policy. + # + # @overload delete_access_policy(request, options = nil) + # Pass arguments to `delete_access_policy` via a request object, either of type + # {::Google::Iam::V3beta::DeleteAccessPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::DeleteAccessPolicyRequest, ::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_access_policy(name: nil, etag: nil, validate_only: nil, force: nil) + # Pass arguments to `delete_access_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 name [::String] + # Required. The name of the access policy to delete. + # + # Format: + # `projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}` + # `folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}` + # @param etag [::String] + # Optional. The etag of the access policy. If this is provided, it must match + # the server's etag. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the deletion, but do not + # actually post it. + # @param force [::Boolean] + # Optional. If set to true, the request will force the deletion of the Policy + # even if the Policy references PolicyBindings. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::AccessPolicies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::DeleteAccessPolicyRequest.new + # + # # Call the delete_access_policy method. + # result = client.delete_access_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_access_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::DeleteAccessPolicyRequest + + # 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_access_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::Iam::V3beta::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_access_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_access_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @access_policies_stub.delete_access_policy request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists access policies. + # + # @overload list_access_policies(request, options = nil) + # Pass arguments to `list_access_policies` via a request object, either of type + # {::Google::Iam::V3beta::ListAccessPoliciesRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::ListAccessPoliciesRequest, ::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_access_policies(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_access_policies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource, which owns the collection of access policy + # resources. + # + # Format: + # `projects/{project_id}/locations/{location}` + # `projects/{project_number}/locations/{location}` + # `folders/{folder_id}/locations/{location}` + # `organizations/{organization_id}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of access policies to return. The + # service may return fewer than this value. + # + # If unspecified, at most 50 access policies will be returned. Valid value + # ranges from 1 to 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `ListAccessPolicies` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `ListAccessPolicies` must match the call that provided the + # page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::AccessPolicy>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::AccessPolicy>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::AccessPolicies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::ListAccessPoliciesRequest.new + # + # # Call the list_access_policies method. + # result = client.list_access_policies 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::Iam::V3beta::AccessPolicy. + # p item + # end + # + def list_access_policies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::ListAccessPoliciesRequest + + # 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_access_policies.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::Iam::V3beta::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_access_policies.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_access_policies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @access_policies_stub.list_access_policies request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @access_policies_stub, :list_access_policies, "access_policies", 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 + + ## + # Returns all policy bindings that bind a specific policy if a user has + # searchPolicyBindings permission on that policy. + # + # @overload search_access_policy_bindings(request, options = nil) + # Pass arguments to `search_access_policy_bindings` via a request object, either of type + # {::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest, ::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 search_access_policy_bindings(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_access_policy_bindings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the access policy. + # Format: + # `organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}` + # @param page_size [::Integer] + # Optional. The maximum number of policy bindings to return. The service may + # return fewer than this value. + # + # If unspecified, at most 50 policy bindings will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `SearchAccessPolicyBindingsRequest` call. Provide this to + # retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `SearchAccessPolicyBindingsRequest` must match the call + # that provided the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::AccessPolicies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::SearchAccessPolicyBindingsRequest.new + # + # # Call the search_access_policy_bindings method. + # result = client.search_access_policy_bindings 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::Iam::V3beta::PolicyBinding. + # p item + # end + # + def search_access_policy_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest + + # 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.search_access_policy_bindings.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::Iam::V3beta::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.search_access_policy_bindings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_access_policy_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @access_policies_stub.search_access_policy_bindings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @access_policies_stub, :search_access_policy_bindings, "policy_bindings", 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 + + ## + # Configuration class for the AccessPolicies REST API. + # + # This class represents the configuration for AccessPolicies REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Iam::V3beta::AccessPolicies::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_access_policy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::V3beta::AccessPolicies::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_access_policy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_access_policy.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "iam.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the AccessPolicies API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_access_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :create_access_policy + ## + # RPC-specific configuration for `get_access_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_access_policy + ## + # RPC-specific configuration for `update_access_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :update_access_policy + ## + # RPC-specific configuration for `delete_access_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_access_policy + ## + # RPC-specific configuration for `list_access_policies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_access_policies + ## + # RPC-specific configuration for `search_access_policy_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :search_access_policy_bindings + + # @private + def initialize parent_rpcs = nil + create_access_policy_config = parent_rpcs.create_access_policy if parent_rpcs.respond_to? :create_access_policy + @create_access_policy = ::Gapic::Config::Method.new create_access_policy_config + get_access_policy_config = parent_rpcs.get_access_policy if parent_rpcs.respond_to? :get_access_policy + @get_access_policy = ::Gapic::Config::Method.new get_access_policy_config + update_access_policy_config = parent_rpcs.update_access_policy if parent_rpcs.respond_to? :update_access_policy + @update_access_policy = ::Gapic::Config::Method.new update_access_policy_config + delete_access_policy_config = parent_rpcs.delete_access_policy if parent_rpcs.respond_to? :delete_access_policy + @delete_access_policy = ::Gapic::Config::Method.new delete_access_policy_config + list_access_policies_config = parent_rpcs.list_access_policies if parent_rpcs.respond_to? :list_access_policies + @list_access_policies = ::Gapic::Config::Method.new list_access_policies_config + search_access_policy_bindings_config = parent_rpcs.search_access_policy_bindings if parent_rpcs.respond_to? :search_access_policy_bindings + @search_access_policy_bindings = ::Gapic::Config::Method.new search_access_policy_bindings_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/operations.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/operations.rb new file mode 100644 index 000000000000..746676e0ba56 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/operations.rb @@ -0,0 +1,937 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Iam + module V3beta + module AccessPolicies + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the AccessPolicies Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the AccessPolicies Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "iam.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.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_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + 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 cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/service_stub.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/service_stub.rb new file mode 100644 index 000000000000..932dd88668d4 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/service_stub.rb @@ -0,0 +1,535 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/iam/v3beta/access_policies_service_pb" + +module Google + module Iam + module V3beta + module AccessPolicies + module Rest + ## + # REST service stub for the AccessPolicies 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 create_access_policy REST call + # + # @param request_pb [::Google::Iam::V3beta::CreateAccessPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_access_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_access_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: "create_access_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_access_policy REST call + # + # @param request_pb [::Google::Iam::V3beta::GetAccessPolicyRequest] + # 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::V3beta::AccessPolicy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V3beta::AccessPolicy] + # A result object deserialized from the server's reply + def get_access_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_access_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_access_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V3beta::AccessPolicy.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_access_policy REST call + # + # @param request_pb [::Google::Iam::V3beta::UpdateAccessPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_access_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_access_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: "update_access_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_access_policy REST call + # + # @param request_pb [::Google::Iam::V3beta::DeleteAccessPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_access_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_access_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: "delete_access_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_access_policies REST call + # + # @param request_pb [::Google::Iam::V3beta::ListAccessPoliciesRequest] + # 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::V3beta::ListAccessPoliciesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V3beta::ListAccessPoliciesResponse] + # A result object deserialized from the server's reply + def list_access_policies request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_access_policies_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_access_policies", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V3beta::ListAccessPoliciesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_access_policy_bindings REST call + # + # @param request_pb [::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest] + # 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::V3beta::SearchAccessPolicyBindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V3beta::SearchAccessPolicyBindingsResponse] + # A result object deserialized from the server's reply + def search_access_policy_bindings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_access_policy_bindings_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: "search_access_policy_bindings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V3beta::SearchAccessPolicyBindingsResponse.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 create_access_policy REST call + # + # @param request_pb [::Google::Iam::V3beta::CreateAccessPolicyRequest] + # 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_access_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3beta/{parent}/accessPolicies", + body: "access_policy", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3beta/{parent}/accessPolicies", + body: "access_policy", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3beta/{parent}/accessPolicies", + body: "access_policy", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_access_policy REST call + # + # @param request_pb [::Google::Iam::V3beta::GetAccessPolicyRequest] + # 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_access_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/accessPolicies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/accessPolicies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/accessPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_access_policy REST call + # + # @param request_pb [::Google::Iam::V3beta::UpdateAccessPolicyRequest] + # 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_access_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3beta/{access_policy.name}", + body: "access_policy", + matches: [ + ["access_policy.name", %r{^projects/[^/]+/locations/[^/]+/accessPolicies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v3beta/{access_policy.name}", + body: "access_policy", + matches: [ + ["access_policy.name", %r{^folders/[^/]+/locations/[^/]+/accessPolicies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v3beta/{access_policy.name}", + body: "access_policy", + matches: [ + ["access_policy.name", %r{^organizations/[^/]+/locations/[^/]+/accessPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_access_policy REST call + # + # @param request_pb [::Google::Iam::V3beta::DeleteAccessPolicyRequest] + # 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_access_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/accessPolicies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/accessPolicies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/accessPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_access_policies REST call + # + # @param request_pb [::Google::Iam::V3beta::ListAccessPoliciesRequest] + # 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_access_policies_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{parent}/accessPolicies", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{parent}/accessPolicies", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{parent}/accessPolicies", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_access_policy_bindings REST call + # + # @param request_pb [::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_access_policy_bindings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}:searchPolicyBindings", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/accessPolicies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}:searchPolicyBindings", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/accessPolicies/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}:searchPolicyBindings", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/accessPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies_service_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies_service_pb.rb new file mode 100644 index 000000000000..f20f2856a2e5 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies_service_pb.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/v3beta/access_policies_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/iam/v3beta/access_policy_resources_pb' +require 'google/iam/v3beta/operation_metadata_pb' +require 'google/iam/v3beta/policy_binding_resources_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' + + +descriptor_data = "\n/google/iam/v3beta/access_policies_service.proto\x12\x11google.iam.v3beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a/google/iam/v3beta/access_policy_resources.proto\x1a*google/iam/v3beta/operation_metadata.proto\x1a\x30google/iam/v3beta/policy_binding_resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\"\xcc\x01\n\x19\x43reateAccessPolicyRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fiam.googleapis.com/AccessPolicy\x12\x1d\n\x10\x61\x63\x63\x65ss_policy_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12;\n\raccess_policy\x18\x03 \x01(\x0b\x32\x1f.google.iam.v3beta.AccessPolicyB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"O\n\x16GetAccessPolicyRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fiam.googleapis.com/AccessPolicy\"t\n\x19UpdateAccessPolicyRequest\x12;\n\raccess_policy\x18\x01 \x01(\x0b\x32\x1f.google.iam.v3beta.AccessPolicyB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\"\x95\x01\n\x19\x44\x65leteAccessPolicyRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fiam.googleapis.com/AccessPolicy\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\x85\x01\n\x19ListAccessPoliciesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fiam.googleapis.com/AccessPolicy\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\"t\n\x1aListAccessPoliciesResponse\x12\x38\n\x0f\x61\x63\x63\x65ss_policies\x18\x01 \x03(\x0b\x32\x1f.google.iam.v3beta.AccessPolicy\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x8b\x01\n!SearchAccessPolicyBindingsRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fiam.googleapis.com/AccessPolicy\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\"}\n\"SearchAccessPolicyBindingsResponse\x12\x39\n\x0fpolicy_bindings\x18\x01 \x03(\x0b\x32 .google.iam.v3beta.PolicyBinding\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x32\xbe\x11\n\x0e\x41\x63\x63\x65ssPolicies\x12\x94\x03\n\x12\x43reateAccessPolicy\x12,.google.iam.v3beta.CreateAccessPolicyRequest\x1a\x1d.google.longrunning.Operation\"\xb0\x02\xca\x41!\n\x0c\x41\x63\x63\x65ssPolicy\x12\x11OperationMetadata\xda\x41%parent,access_policy,access_policy_id\x82\xd3\xe4\x93\x02\xdd\x01\"6/v3beta/{parent=projects/*/locations/*}/accessPolicies:\raccess_policyZF\"5/v3beta/{parent=folders/*/locations/*}/accessPolicies:\raccess_policyZL\";/v3beta/{parent=organizations/*/locations/*}/accessPolicies:\raccess_policy\x12\x9e\x02\n\x0fGetAccessPolicy\x12).google.iam.v3beta.GetAccessPolicyRequest\x1a\x1f.google.iam.v3beta.AccessPolicy\"\xbe\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xb0\x01\x12\x36/v3beta/{name=projects/*/locations/*/accessPolicies/*}Z7\x12\x35/v3beta/{name=folders/*/locations/*/accessPolicies/*}Z=\x12;/v3beta/{name=organizations/*/locations/*/accessPolicies/*}\x12\x96\x03\n\x12UpdateAccessPolicy\x12,.google.iam.v3beta.UpdateAccessPolicyRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x02\xca\x41!\n\x0c\x41\x63\x63\x65ssPolicy\x12\x11OperationMetadata\x82\xd3\xe4\x93\x02\x87\x02\x32\x44/v3beta/{access_policy.name=projects/*/locations/*/accessPolicies/*}:\raccess_policyZT2C/v3beta/{access_policy.name=folders/*/locations/*/accessPolicies/*}:\raccess_policyZZ2I/v3beta/{access_policy.name=organizations/*/locations/*/accessPolicies/*}:\raccess_policy\x12\xcf\x02\n\x12\x44\x65leteAccessPolicy\x12,.google.iam.v3beta.DeleteAccessPolicyRequest\x1a\x1d.google.longrunning.Operation\"\xeb\x01\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\xb0\x01*6/v3beta/{name=projects/*/locations/*/accessPolicies/*}Z7*5/v3beta/{name=folders/*/locations/*/accessPolicies/*}Z=*;/v3beta/{name=organizations/*/locations/*/accessPolicies/*}\x12\xb4\x02\n\x12ListAccessPolicies\x12,.google.iam.v3beta.ListAccessPoliciesRequest\x1a-.google.iam.v3beta.ListAccessPoliciesResponse\"\xc0\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xb0\x01\x12\x36/v3beta/{parent=projects/*/locations/*}/accessPoliciesZ7\x12\x35/v3beta/{parent=folders/*/locations/*}/accessPoliciesZ=\x12;/v3beta/{parent=organizations/*/locations/*}/accessPolicies\x12\x89\x03\n\x1aSearchAccessPolicyBindings\x12\x34.google.iam.v3beta.SearchAccessPolicyBindingsRequest\x1a\x35.google.iam.v3beta.SearchAccessPolicyBindingsResponse\"\xfd\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xef\x01\x12P/v3beta/{name=organizations/*/locations/*/accessPolicies/*}:searchPolicyBindingsZL\x12J/v3beta/{name=folders/*/locations/*/accessPolicies/*}:searchPolicyBindingsZM\x12K/v3beta/{name=projects/*/locations/*/accessPolicies/*}:searchPolicyBindings\x1a\x46\xca\x41\x12iam.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x91\x01\n\x15\x63om.google.iam.v3betaB\x13\x41\x63\x63\x65ssPoliciesProtoP\x01Z-cloud.google.com/go/iam/apiv3beta/iampb;iampb\xaa\x02\x17Google.Cloud.Iam.V3Beta\xca\x02\x17Google\\Cloud\\Iam\\V3betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module V3beta + CreateAccessPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.CreateAccessPolicyRequest").msgclass + GetAccessPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.GetAccessPolicyRequest").msgclass + UpdateAccessPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.UpdateAccessPolicyRequest").msgclass + DeleteAccessPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.DeleteAccessPolicyRequest").msgclass + ListAccessPoliciesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.ListAccessPoliciesRequest").msgclass + ListAccessPoliciesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.ListAccessPoliciesResponse").msgclass + SearchAccessPolicyBindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.SearchAccessPolicyBindingsRequest").msgclass + SearchAccessPolicyBindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.SearchAccessPolicyBindingsResponse").msgclass + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies_service_services_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies_service_services_pb.rb new file mode 100644 index 000000000000..fb03418341a3 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies_service_services_pb.rb @@ -0,0 +1,54 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/iam/v3beta/access_policies_service.proto for package 'google.iam.v3beta' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/iam/v3beta/access_policies_service_pb' + +module Google + module Iam + module V3beta + module AccessPolicies + # Manages Identity and Access Management (IAM) access policies. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.iam.v3beta.AccessPolicies' + + # Creates an access policy, and returns a long running operation. + rpc :CreateAccessPolicy, ::Google::Iam::V3beta::CreateAccessPolicyRequest, ::Google::Longrunning::Operation + # Gets an access policy. + rpc :GetAccessPolicy, ::Google::Iam::V3beta::GetAccessPolicyRequest, ::Google::Iam::V3beta::AccessPolicy + # Updates an access policy. + rpc :UpdateAccessPolicy, ::Google::Iam::V3beta::UpdateAccessPolicyRequest, ::Google::Longrunning::Operation + # Deletes an access policy. + rpc :DeleteAccessPolicy, ::Google::Iam::V3beta::DeleteAccessPolicyRequest, ::Google::Longrunning::Operation + # Lists access policies. + rpc :ListAccessPolicies, ::Google::Iam::V3beta::ListAccessPoliciesRequest, ::Google::Iam::V3beta::ListAccessPoliciesResponse + # Returns all policy bindings that bind a specific policy if a user has + # searchPolicyBindings permission on that policy. + rpc :SearchAccessPolicyBindings, ::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest, ::Google::Iam::V3beta::SearchAccessPolicyBindingsResponse + end + + Stub = Service.rpc_stub_class + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policy_resources_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policy_resources_pb.rb new file mode 100644 index 000000000000..43366a70afff --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policy_resources_pb.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/v3beta/access_policy_resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' +require 'google/type/expr_pb' + + +descriptor_data = "\n/google/iam/v3beta/access_policy_resources.proto\x12\x11google.iam.v3beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x16google/type/expr.proto\"\xb9\x05\n\x0c\x41\x63\x63\x65ssPolicy\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x18\n\x03uid\x18\x02 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12J\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x30.google.iam.v3beta.AccessPolicy.AnnotationsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x07\x64\x65tails\x18\x08 \x01(\x0b\x32&.google.iam.v3beta.AccessPolicyDetailsB\x03\xe0\x41\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:\xa3\x02\xea\x41\x9f\x02\n\x1fiam.googleapis.com/AccessPolicy\x12Porganizations/{organization}/locations/{location}/accessPolicies/{access_policy}\x12\x44\x66olders/{folder}/locations/{location}/accessPolicies/{access_policy}\x12\x46projects/{project}/locations/{location}/accessPolicies/{access_policy}*\x0e\x61\x63\x63\x65ssPolicies2\x0c\x61\x63\x63\x65ssPolicy\"N\n\x13\x41\x63\x63\x65ssPolicyDetails\x12\x37\n\x05rules\x18\x01 \x03(\x0b\x32#.google.iam.v3beta.AccessPolicyRuleB\x03\xe0\x41\x02\"\xa9\x04\n\x10\x41\x63\x63\x65ssPolicyRule\x12\x1d\n\x0b\x64\x65scription\x18\x01 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x12\x44\n\x06\x65\x66\x66\x65\x63t\x18\x02 \x01(\x0e\x32*.google.iam.v3beta.AccessPolicyRule.EffectB\x03\xe0\x41\x02H\x01\x88\x01\x01\x12\x17\n\nprincipals\x18\x03 \x03(\tB\x03\xe0\x41\x02\x12 \n\x13\x65xcluded_principals\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x45\n\toperation\x18\n \x01(\x0b\x32-.google.iam.v3beta.AccessPolicyRule.OperationB\x03\xe0\x41\x02\x12L\n\nconditions\x18\t \x03(\x0b\x32\x33.google.iam.v3beta.AccessPolicyRule.ConditionsEntryB\x03\xe0\x41\x01\x1aH\n\tOperation\x12\x18\n\x0bpermissions\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12!\n\x14\x65xcluded_permissions\x18\x02 \x03(\tB\x03\xe0\x41\x01\x1a\x44\n\x0f\x43onditionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12 \n\x05value\x18\x02 \x01(\x0b\x32\x11.google.type.Expr:\x02\x38\x01\"5\n\x06\x45\x66\x66\x65\x63t\x12\x16\n\x12\x45\x46\x46\x45\x43T_UNSPECIFIED\x10\x00\x12\x08\n\x04\x44\x45NY\x10\x01\x12\t\n\x05\x41LLOW\x10\x02\x42\x0e\n\x0c_descriptionB\t\n\x07_effectB\x98\x01\n\x15\x63om.google.iam.v3betaB\x1a\x41\x63\x63\x65ssPolicyResourcesProtoP\x01Z-cloud.google.com/go/iam/apiv3beta/iampb;iampb\xaa\x02\x17Google.Cloud.Iam.V3Beta\xca\x02\x17Google\\Cloud\\Iam\\V3betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module V3beta + AccessPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.AccessPolicy").msgclass + AccessPolicyDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.AccessPolicyDetails").msgclass + AccessPolicyRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.AccessPolicyRule").msgclass + AccessPolicyRule::Operation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.AccessPolicyRule.Operation").msgclass + AccessPolicyRule::Effect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.AccessPolicyRule.Effect").enummodule + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/operation_metadata_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/operation_metadata_pb.rb new file mode 100644 index 000000000000..84f3e0210548 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/operation_metadata_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/v3beta/operation_metadata.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n*google/iam/v3beta/operation_metadata.proto\x12\x11google.iam.v3beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x42\x94\x01\n\x15\x63om.google.iam.v3betaB\x16OperationMetadataProtoP\x01Z-cloud.google.com/go/iam/apiv3beta/iampb;iampb\xaa\x02\x17Google.Cloud.Iam.V3Beta\xca\x02\x17Google\\Cloud\\Iam\\V3betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module V3beta + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.OperationMetadata").msgclass + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_binding_resources_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_binding_resources_pb.rb new file mode 100644 index 000000000000..ec1093319476 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_binding_resources_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/v3beta/policy_binding_resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' +require 'google/type/expr_pb' + + +descriptor_data = "\n0google/iam/v3beta/policy_binding_resources.proto\x12\x11google.iam.v3beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x16google/type/expr.proto\"\x87\x08\n\rPolicyBinding\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x18\n\x03uid\x18\x02 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12K\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x31.google.iam.v3beta.PolicyBinding.AnnotationsEntryB\x03\xe0\x41\x01\x12?\n\x06target\x18\x06 \x01(\x0b\x32\'.google.iam.v3beta.PolicyBinding.TargetB\x06\xe0\x41\x05\xe0\x41\x02\x12\x45\n\x0bpolicy_kind\x18\x0b \x01(\x0e\x32+.google.iam.v3beta.PolicyBinding.PolicyKindB\x03\xe0\x41\x05\x12\x16\n\x06policy\x18\x07 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x02\x12\x17\n\npolicy_uid\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12)\n\tcondition\x18\x08 \x01(\x0b\x32\x11.google.type.ExprB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1aI\n\x06Target\x12\x1c\n\rprincipal_set\x18\x01 \x01(\tB\x03\xe0\x41\x05H\x00\x12\x17\n\x08resource\x18\x02 \x01(\tB\x03\xe0\x41\x05H\x00\x42\x08\n\x06target\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\nPolicyKind\x12\x1b\n\x17POLICY_KIND_UNSPECIFIED\x10\x00\x12\x1d\n\x19PRINCIPAL_ACCESS_BOUNDARY\x10\x01\x12\n\n\x06\x41\x43\x43\x45SS\x10\x02:\xa8\x02\xea\x41\xa4\x02\n iam.googleapis.com/PolicyBinding\x12Qorganizations/{organization}/locations/{location}/policyBindings/{policy_binding}\x12\x45\x66olders/{folder}/locations/{location}/policyBindings/{policy_binding}\x12Gprojects/{project}/locations/{location}/policyBindings/{policy_binding}*\x0epolicyBindings2\rpolicyBindingB\x99\x01\n\x15\x63om.google.iam.v3betaB\x1bPolicyBindingResourcesProtoP\x01Z-cloud.google.com/go/iam/apiv3beta/iampb;iampb\xaa\x02\x17Google.Cloud.Iam.V3Beta\xca\x02\x17Google\\Cloud\\Iam\\V3betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module V3beta + PolicyBinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.PolicyBinding").msgclass + PolicyBinding::Target = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.PolicyBinding.Target").msgclass + PolicyBinding::PolicyKind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.PolicyBinding.PolicyKind").enummodule + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings.rb new file mode 100644 index 000000000000..18b509490856 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v3beta/version" + +require "google/iam/v3beta/policy_bindings/credentials" +require "google/iam/v3beta/policy_bindings/paths" +require "google/iam/v3beta/policy_bindings/operations" +require "google/iam/v3beta/policy_bindings/client" +require "google/iam/v3beta/policy_bindings/rest" + +module Google + module Iam + module V3beta + ## + # An interface for managing Identity and Access Management (IAM) policy + # bindings. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/iam/v3beta/policy_bindings" + # client = ::Google::Iam::V3beta::PolicyBindings::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/iam/v3beta/policy_bindings/rest" + # client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new + # + module PolicyBindings + end + end + end +end + +helper_path = ::File.join __dir__, "policy_bindings", "helpers.rb" +require "google/iam/v3beta/policy_bindings/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/client.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/client.rb new file mode 100644 index 000000000000..a7b0d7f2dc80 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/client.rb @@ -0,0 +1,1155 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/iam/v3beta/policy_bindings_service_pb" +require "google/cloud/location" + +module Google + module Iam + module V3beta + module PolicyBindings + ## + # Client for the PolicyBindings service. + # + # An interface for managing Identity and Access Management (IAM) policy + # bindings. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :policy_bindings_stub + + ## + # Configure the PolicyBindings Client class. + # + # See {::Google::Iam::V3beta::PolicyBindings::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PolicyBindings clients + # ::Google::Iam::V3beta::PolicyBindings::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Iam", "V3beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_policy_binding.timeout = 30.0 + + default_config.rpcs.get_policy_binding.timeout = 60.0 + default_config.rpcs.get_policy_binding.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_policy_binding.timeout = 30.0 + + default_config.rpcs.delete_policy_binding.timeout = 30.0 + + default_config.rpcs.list_policy_bindings.timeout = 60.0 + default_config.rpcs.list_policy_bindings.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_target_policy_bindings.timeout = 60.0 + default_config.rpcs.search_target_policy_bindings.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PolicyBindings Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Iam::V3beta::PolicyBindings::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 + @policy_bindings_stub.universe_domain + end + + ## + # Create a new PolicyBindings client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Iam::V3beta::PolicyBindings::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PolicyBindings client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/iam/v3beta/policy_bindings_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 + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @policy_bindings_stub = ::Gapic::ServiceStub.new( + ::Google::Iam::V3beta::PolicyBindings::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 + ) + + @policy_bindings_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 = @policy_bindings_stub.endpoint + config.universe_domain = @policy_bindings_stub.universe_domain + config.logger = @policy_bindings_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Iam::V3beta::PolicyBindings::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @policy_bindings_stub.logger + end + + # Service calls + + ## + # Creates a policy binding and returns a long-running operation. + # Callers will need the IAM permissions on both the policy and target. + # After the binding is created, the policy is applied to the target. + # + # @overload create_policy_binding(request, options = nil) + # Pass arguments to `create_policy_binding` via a request object, either of type + # {::Google::Iam::V3beta::CreatePolicyBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::CreatePolicyBindingRequest, ::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_policy_binding(parent: nil, policy_binding_id: nil, policy_binding: nil, validate_only: nil) + # Pass arguments to `create_policy_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this policy binding will be created. + # The binding parent is the closest Resource Manager resource (project, + # folder or organization) to the binding target. + # + # Format: + # + # * `projects/{project_id}/locations/{location}` + # * `projects/{project_number}/locations/{location}` + # * `folders/{folder_id}/locations/{location}` + # * `organizations/{organization_id}/locations/{location}` + # @param policy_binding_id [::String] + # Required. The ID to use for the policy binding, which will become the final + # component of the policy binding's resource name. + # + # This value must start with a lowercase letter followed by up to 62 + # lowercase letters, numbers, hyphens, or dots. Pattern, + # /[a-z][a-z0-9-\.]\\{2,62}/. + # @param policy_binding [::Google::Iam::V3beta::PolicyBinding, ::Hash] + # Required. The policy binding to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the creation, but do not + # actually post it. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PolicyBindings::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::CreatePolicyBindingRequest.new + # + # # Call the create_policy_binding method. + # result = client.create_policy_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_policy_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::CreatePolicyBindingRequest + + # 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_policy_binding.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::Iam::V3beta::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_policy_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_policy_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_bindings_stub.call_rpc :create_policy_binding, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a policy binding. + # + # @overload get_policy_binding(request, options = nil) + # Pass arguments to `get_policy_binding` via a request object, either of type + # {::Google::Iam::V3beta::GetPolicyBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::GetPolicyBindingRequest, ::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_policy_binding(name: nil) + # Pass arguments to `get_policy_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the policy binding to retrieve. + # + # Format: + # + # * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` + # * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` + # * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` + # * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V3beta::PolicyBinding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V3beta::PolicyBinding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PolicyBindings::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::GetPolicyBindingRequest.new + # + # # Call the get_policy_binding method. + # result = client.get_policy_binding request + # + # # The returned object is of type Google::Iam::V3beta::PolicyBinding. + # p result + # + def get_policy_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::GetPolicyBindingRequest + + # 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_policy_binding.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::Iam::V3beta::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_policy_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_policy_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_bindings_stub.call_rpc :get_policy_binding, 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 a policy binding and returns a long-running operation. + # Callers will need the IAM permissions on the policy and target in the + # binding to update. Target and policy are immutable and cannot be updated. + # + # @overload update_policy_binding(request, options = nil) + # Pass arguments to `update_policy_binding` via a request object, either of type + # {::Google::Iam::V3beta::UpdatePolicyBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::UpdatePolicyBindingRequest, ::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_policy_binding(policy_binding: nil, validate_only: nil, update_mask: nil) + # Pass arguments to `update_policy_binding` 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 policy_binding [::Google::Iam::V3beta::PolicyBinding, ::Hash] + # Required. The policy binding to update. + # + # The policy binding's `name` field is used to identify the policy binding to + # update. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the update, but do not + # actually post it. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The list of fields to update + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PolicyBindings::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::UpdatePolicyBindingRequest.new + # + # # Call the update_policy_binding method. + # result = client.update_policy_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_policy_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::UpdatePolicyBindingRequest + + # 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_policy_binding.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::Iam::V3beta::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.policy_binding&.name + header_params["policy_binding.name"] = request.policy_binding.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_policy_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_policy_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_bindings_stub.call_rpc :update_policy_binding, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a policy binding and returns a long-running operation. + # Callers will need the IAM permissions on both the policy and target. + # After the binding is deleted, the policy no longer applies to the target. + # + # @overload delete_policy_binding(request, options = nil) + # Pass arguments to `delete_policy_binding` via a request object, either of type + # {::Google::Iam::V3beta::DeletePolicyBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::DeletePolicyBindingRequest, ::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_policy_binding(name: nil, etag: nil, validate_only: nil) + # Pass arguments to `delete_policy_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the policy binding to delete. + # + # Format: + # + # * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` + # * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` + # * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` + # * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` + # @param etag [::String] + # Optional. The etag of the policy binding. + # If this is provided, it must match the server's etag. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the deletion, but do not + # actually post it. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PolicyBindings::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::DeletePolicyBindingRequest.new + # + # # Call the delete_policy_binding method. + # result = client.delete_policy_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_policy_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::DeletePolicyBindingRequest + + # 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_policy_binding.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::Iam::V3beta::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_policy_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_policy_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_bindings_stub.call_rpc :delete_policy_binding, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists policy bindings. + # + # @overload list_policy_bindings(request, options = nil) + # Pass arguments to `list_policy_bindings` via a request object, either of type + # {::Google::Iam::V3beta::ListPolicyBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::ListPolicyBindingsRequest, ::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_policy_bindings(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_policy_bindings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource, which owns the collection of policy + # bindings. + # + # Format: + # + # * `projects/{project_id}/locations/{location}` + # * `projects/{project_number}/locations/{location}` + # * `folders/{folder_id}/locations/{location}` + # * `organizations/{organization_id}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of policy bindings to return. The service may + # return fewer than this value. + # + # The default value is 50. The maximum value is 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListPolicyBindings` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListPolicyBindings` must + # match the call that provided the page token. + # @param filter [::String] + # Optional. An expression for filtering the results of the request. Filter + # rules are case insensitive. Some eligible fields for filtering are the + # following: + # + # + `target` + # + `policy` + # + # Some examples of filter queries: + # + # * `target:ex*`: The binding target's name starts with "ex". + # * `target:example`: The binding target's name is `example`. + # * `policy:example`: The binding policy's name is `example`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PolicyBindings::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::ListPolicyBindingsRequest.new + # + # # Call the list_policy_bindings method. + # result = client.list_policy_bindings 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::Iam::V3beta::PolicyBinding. + # p item + # end + # + def list_policy_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::ListPolicyBindingsRequest + + # 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_policy_bindings.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::Iam::V3beta::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_policy_bindings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_policy_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_bindings_stub.call_rpc :list_policy_bindings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @policy_bindings_stub, :list_policy_bindings, 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 + + ## + # Search policy bindings by target. Returns all policy binding objects bound + # directly to target. + # + # @overload search_target_policy_bindings(request, options = nil) + # Pass arguments to `search_target_policy_bindings` via a request object, either of type + # {::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest, ::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 search_target_policy_bindings(target: nil, page_size: nil, page_token: nil, parent: nil, filter: nil) + # Pass arguments to `search_target_policy_bindings` 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 target [::String] + # Required. The target resource, which is bound to the policy in the binding. + # + # Format: + # + # * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID` + # * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID` + # * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID` + # * `//cloudresourcemanager.googleapis.com/projects/{project_number}` + # * `//cloudresourcemanager.googleapis.com/folders/{folder_id}` + # * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}` + # @param page_size [::Integer] + # Optional. The maximum number of policy bindings to return. The service may + # return fewer than this value. + # + # The default value is 50. The maximum value is 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `SearchTargetPolicyBindingsRequest` must match the call that provided the + # page token. + # @param parent [::String] + # Required. The parent resource where this search will be performed. This + # should be the nearest Resource Manager resource (project, folder, or + # organization) to the target. + # + # Format: + # + # * `projects/{project_id}/locations/{location}` + # * `projects/{project_number}/locations/{location}` + # * `folders/{folder_id}/locations/{location}` + # * `organizations/{organization_id}/locations/{location}` + # @param filter [::String] + # Optional. Filtering currently only supports the kind of policies to return, + # and must be in the format "policy_kind=\\{policy_kind}". + # + # If String is empty, bindings bound to all kinds of policies would be + # returned. + # + # The only supported values are the following: + # + # * "policy_kind=PRINCIPAL_ACCESS_BOUNDARY", + # * "policy_kind=ACCESS" + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PolicyBindings::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new + # + # # Call the search_target_policy_bindings method. + # result = client.search_target_policy_bindings 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::Iam::V3beta::PolicyBinding. + # p item + # end + # + def search_target_policy_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest + + # 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.search_target_policy_bindings.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::Iam::V3beta::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.search_target_policy_bindings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_target_policy_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_bindings_stub.call_rpc :search_target_policy_bindings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @policy_bindings_stub, :search_target_policy_bindings, 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 + + ## + # Configuration class for the PolicyBindings API. + # + # This class represents the configuration for PolicyBindings, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Iam::V3beta::PolicyBindings::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_policy_binding to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::V3beta::PolicyBindings::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_policy_binding.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_policy_binding.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "iam.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 PolicyBindings API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_policy_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_policy_binding + ## + # RPC-specific configuration for `get_policy_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_policy_binding + ## + # RPC-specific configuration for `update_policy_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_policy_binding + ## + # RPC-specific configuration for `delete_policy_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_policy_binding + ## + # RPC-specific configuration for `list_policy_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_policy_bindings + ## + # RPC-specific configuration for `search_target_policy_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :search_target_policy_bindings + + # @private + def initialize parent_rpcs = nil + create_policy_binding_config = parent_rpcs.create_policy_binding if parent_rpcs.respond_to? :create_policy_binding + @create_policy_binding = ::Gapic::Config::Method.new create_policy_binding_config + get_policy_binding_config = parent_rpcs.get_policy_binding if parent_rpcs.respond_to? :get_policy_binding + @get_policy_binding = ::Gapic::Config::Method.new get_policy_binding_config + update_policy_binding_config = parent_rpcs.update_policy_binding if parent_rpcs.respond_to? :update_policy_binding + @update_policy_binding = ::Gapic::Config::Method.new update_policy_binding_config + delete_policy_binding_config = parent_rpcs.delete_policy_binding if parent_rpcs.respond_to? :delete_policy_binding + @delete_policy_binding = ::Gapic::Config::Method.new delete_policy_binding_config + list_policy_bindings_config = parent_rpcs.list_policy_bindings if parent_rpcs.respond_to? :list_policy_bindings + @list_policy_bindings = ::Gapic::Config::Method.new list_policy_bindings_config + search_target_policy_bindings_config = parent_rpcs.search_target_policy_bindings if parent_rpcs.respond_to? :search_target_policy_bindings + @search_target_policy_bindings = ::Gapic::Config::Method.new search_target_policy_bindings_config + + yield self if block_given? + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/credentials.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/credentials.rb new file mode 100644 index 000000000000..8544d9e0da3c --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/credentials.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 "googleauth" + +module Google + module Iam + module V3beta + module PolicyBindings + # Credentials for the PolicyBindings API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/operations.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/operations.rb new file mode 100644 index 000000000000..0597a41d3fe7 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/operations.rb @@ -0,0 +1,839 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Iam + module V3beta + module PolicyBindings + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the PolicyBindings Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the PolicyBindings Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "iam.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/paths.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/paths.rb new file mode 100644 index 000000000000..b4c61be97d31 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/paths.rb @@ -0,0 +1,140 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 V3beta + module PolicyBindings + # Path helper methods for the PolicyBindings API. + module Paths + ## + # Create a fully-qualified FolderLocation resource string. + # + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}` + # + # @param folder [String] + # @param location [String] + # + # @return [::String] + def folder_location_path folder:, location: + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + + "folders/#{folder}/locations/#{location}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified OrganizationLocation resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}` + # + # @param organization [String] + # @param location [String] + # + # @return [::String] + def organization_location_path organization:, location: + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}" + end + + ## + # Create a fully-qualified PolicyBinding resource string. + # + # @overload policy_binding_path(organization:, location:, policy_binding:) + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/policyBindings/{policy_binding}` + # + # @param organization [String] + # @param location [String] + # @param policy_binding [String] + # + # @overload policy_binding_path(folder:, location:, policy_binding:) + # The resource will be in the following format: + # + # `folders/{folder}/locations/{location}/policyBindings/{policy_binding}` + # + # @param folder [String] + # @param location [String] + # @param policy_binding [String] + # + # @overload policy_binding_path(project:, location:, policy_binding:) + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/policyBindings/{policy_binding}` + # + # @param project [String] + # @param location [String] + # @param policy_binding [String] + # + # @return [::String] + def policy_binding_path **args + resources = { + "location:organization:policy_binding" => (proc do |organization:, location:, policy_binding:| + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/policyBindings/#{policy_binding}" + end), + "folder:location:policy_binding" => (proc do |folder:, location:, policy_binding:| + raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "folders/#{folder}/locations/#{location}/policyBindings/#{policy_binding}" + end), + "location:policy_binding:project" => (proc do |project:, location:, policy_binding:| + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/policyBindings/#{policy_binding}" + end) + } + + resource = resources[args.keys.sort.join(":")] + raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? + resource.call(**args) + end + + extend self + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest.rb new file mode 100644 index 000000000000..f067a9724971 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v3beta/version" + +require "google/iam/v3beta/policy_bindings/credentials" +require "google/iam/v3beta/policy_bindings/paths" +require "google/iam/v3beta/policy_bindings/rest/operations" +require "google/iam/v3beta/policy_bindings/rest/client" + +module Google + module Iam + module V3beta + ## + # An interface for managing Identity and Access Management (IAM) policy + # bindings. + # + # To load this service and instantiate a REST client: + # + # require "google/iam/v3beta/policy_bindings/rest" + # client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new + # + module PolicyBindings + # Client for the REST transport + module Rest + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/iam/v3beta/policy_bindings/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/client.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/client.rb new file mode 100644 index 000000000000..43ed8dc0f6ce --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/client.rb @@ -0,0 +1,1070 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/iam/v3beta/policy_bindings_service_pb" +require "google/iam/v3beta/policy_bindings/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Iam + module V3beta + module PolicyBindings + module Rest + ## + # REST client for the PolicyBindings service. + # + # An interface for managing Identity and Access Management (IAM) policy + # bindings. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :policy_bindings_stub + + ## + # Configure the PolicyBindings Client class. + # + # See {::Google::Iam::V3beta::PolicyBindings::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PolicyBindings clients + # ::Google::Iam::V3beta::PolicyBindings::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Iam", "V3beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_policy_binding.timeout = 30.0 + + default_config.rpcs.get_policy_binding.timeout = 60.0 + default_config.rpcs.get_policy_binding.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_policy_binding.timeout = 30.0 + + default_config.rpcs.delete_policy_binding.timeout = 30.0 + + default_config.rpcs.list_policy_bindings.timeout = 60.0 + default_config.rpcs.list_policy_bindings.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_target_policy_bindings.timeout = 60.0 + default_config.rpcs.search_target_policy_bindings.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PolicyBindings Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Iam::V3beta::PolicyBindings::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 + @policy_bindings_stub.universe_domain + end + + ## + # Create a new PolicyBindings REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PolicyBindings client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Iam::V3beta::PolicyBindings::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @policy_bindings_stub = ::Google::Iam::V3beta::PolicyBindings::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @policy_bindings_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 = @policy_bindings_stub.endpoint + config.universe_domain = @policy_bindings_stub.universe_domain + config.logger = @policy_bindings_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Iam::V3beta::PolicyBindings::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @policy_bindings_stub.logger + end + + # Service calls + + ## + # Creates a policy binding and returns a long-running operation. + # Callers will need the IAM permissions on both the policy and target. + # After the binding is created, the policy is applied to the target. + # + # @overload create_policy_binding(request, options = nil) + # Pass arguments to `create_policy_binding` via a request object, either of type + # {::Google::Iam::V3beta::CreatePolicyBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::CreatePolicyBindingRequest, ::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_policy_binding(parent: nil, policy_binding_id: nil, policy_binding: nil, validate_only: nil) + # Pass arguments to `create_policy_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource where this policy binding will be created. + # The binding parent is the closest Resource Manager resource (project, + # folder or organization) to the binding target. + # + # Format: + # + # * `projects/{project_id}/locations/{location}` + # * `projects/{project_number}/locations/{location}` + # * `folders/{folder_id}/locations/{location}` + # * `organizations/{organization_id}/locations/{location}` + # @param policy_binding_id [::String] + # Required. The ID to use for the policy binding, which will become the final + # component of the policy binding's resource name. + # + # This value must start with a lowercase letter followed by up to 62 + # lowercase letters, numbers, hyphens, or dots. Pattern, + # /[a-z][a-z0-9-\.]\\{2,62}/. + # @param policy_binding [::Google::Iam::V3beta::PolicyBinding, ::Hash] + # Required. The policy binding to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the creation, but do not + # actually post it. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PolicyBindings::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::CreatePolicyBindingRequest.new + # + # # Call the create_policy_binding method. + # result = client.create_policy_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_policy_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::CreatePolicyBindingRequest + + # 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_policy_binding.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::Iam::V3beta::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_policy_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_policy_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_bindings_stub.create_policy_binding request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 a policy binding. + # + # @overload get_policy_binding(request, options = nil) + # Pass arguments to `get_policy_binding` via a request object, either of type + # {::Google::Iam::V3beta::GetPolicyBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::GetPolicyBindingRequest, ::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_policy_binding(name: nil) + # Pass arguments to `get_policy_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the policy binding to retrieve. + # + # Format: + # + # * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` + # * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` + # * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` + # * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V3beta::PolicyBinding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V3beta::PolicyBinding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PolicyBindings::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::GetPolicyBindingRequest.new + # + # # Call the get_policy_binding method. + # result = client.get_policy_binding request + # + # # The returned object is of type Google::Iam::V3beta::PolicyBinding. + # p result + # + def get_policy_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::GetPolicyBindingRequest + + # 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_policy_binding.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::Iam::V3beta::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_policy_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_policy_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_bindings_stub.get_policy_binding 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 a policy binding and returns a long-running operation. + # Callers will need the IAM permissions on the policy and target in the + # binding to update. Target and policy are immutable and cannot be updated. + # + # @overload update_policy_binding(request, options = nil) + # Pass arguments to `update_policy_binding` via a request object, either of type + # {::Google::Iam::V3beta::UpdatePolicyBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::UpdatePolicyBindingRequest, ::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_policy_binding(policy_binding: nil, validate_only: nil, update_mask: nil) + # Pass arguments to `update_policy_binding` 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 policy_binding [::Google::Iam::V3beta::PolicyBinding, ::Hash] + # Required. The policy binding to update. + # + # The policy binding's `name` field is used to identify the policy binding to + # update. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the update, but do not + # actually post it. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The list of fields to update + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PolicyBindings::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::UpdatePolicyBindingRequest.new + # + # # Call the update_policy_binding method. + # result = client.update_policy_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_policy_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::UpdatePolicyBindingRequest + + # 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_policy_binding.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::Iam::V3beta::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_policy_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_policy_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_bindings_stub.update_policy_binding request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a policy binding and returns a long-running operation. + # Callers will need the IAM permissions on both the policy and target. + # After the binding is deleted, the policy no longer applies to the target. + # + # @overload delete_policy_binding(request, options = nil) + # Pass arguments to `delete_policy_binding` via a request object, either of type + # {::Google::Iam::V3beta::DeletePolicyBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::DeletePolicyBindingRequest, ::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_policy_binding(name: nil, etag: nil, validate_only: nil) + # Pass arguments to `delete_policy_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the policy binding to delete. + # + # Format: + # + # * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` + # * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` + # * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` + # * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` + # @param etag [::String] + # Optional. The etag of the policy binding. + # If this is provided, it must match the server's etag. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the deletion, but do not + # actually post it. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PolicyBindings::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::DeletePolicyBindingRequest.new + # + # # Call the delete_policy_binding method. + # result = client.delete_policy_binding request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_policy_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::DeletePolicyBindingRequest + + # 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_policy_binding.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::Iam::V3beta::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_policy_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_policy_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_bindings_stub.delete_policy_binding request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists policy bindings. + # + # @overload list_policy_bindings(request, options = nil) + # Pass arguments to `list_policy_bindings` via a request object, either of type + # {::Google::Iam::V3beta::ListPolicyBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::ListPolicyBindingsRequest, ::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_policy_bindings(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_policy_bindings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource, which owns the collection of policy + # bindings. + # + # Format: + # + # * `projects/{project_id}/locations/{location}` + # * `projects/{project_number}/locations/{location}` + # * `folders/{folder_id}/locations/{location}` + # * `organizations/{organization_id}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of policy bindings to return. The service may + # return fewer than this value. + # + # The default value is 50. The maximum value is 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListPolicyBindings` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListPolicyBindings` must + # match the call that provided the page token. + # @param filter [::String] + # Optional. An expression for filtering the results of the request. Filter + # rules are case insensitive. Some eligible fields for filtering are the + # following: + # + # + `target` + # + `policy` + # + # Some examples of filter queries: + # + # * `target:ex*`: The binding target's name starts with "ex". + # * `target:example`: The binding target's name is `example`. + # * `policy:example`: The binding policy's name is `example`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PolicyBindings::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::ListPolicyBindingsRequest.new + # + # # Call the list_policy_bindings method. + # result = client.list_policy_bindings 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::Iam::V3beta::PolicyBinding. + # p item + # end + # + def list_policy_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::ListPolicyBindingsRequest + + # 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_policy_bindings.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::Iam::V3beta::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_policy_bindings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_policy_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_bindings_stub.list_policy_bindings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @policy_bindings_stub, :list_policy_bindings, "policy_bindings", 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 + + ## + # Search policy bindings by target. Returns all policy binding objects bound + # directly to target. + # + # @overload search_target_policy_bindings(request, options = nil) + # Pass arguments to `search_target_policy_bindings` via a request object, either of type + # {::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest, ::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 search_target_policy_bindings(target: nil, page_size: nil, page_token: nil, parent: nil, filter: nil) + # Pass arguments to `search_target_policy_bindings` 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 target [::String] + # Required. The target resource, which is bound to the policy in the binding. + # + # Format: + # + # * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID` + # * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID` + # * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID` + # * `//cloudresourcemanager.googleapis.com/projects/{project_number}` + # * `//cloudresourcemanager.googleapis.com/folders/{folder_id}` + # * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}` + # @param page_size [::Integer] + # Optional. The maximum number of policy bindings to return. The service may + # return fewer than this value. + # + # The default value is 50. The maximum value is 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `SearchTargetPolicyBindingsRequest` must match the call that provided the + # page token. + # @param parent [::String] + # Required. The parent resource where this search will be performed. This + # should be the nearest Resource Manager resource (project, folder, or + # organization) to the target. + # + # Format: + # + # * `projects/{project_id}/locations/{location}` + # * `projects/{project_number}/locations/{location}` + # * `folders/{folder_id}/locations/{location}` + # * `organizations/{organization_id}/locations/{location}` + # @param filter [::String] + # Optional. Filtering currently only supports the kind of policies to return, + # and must be in the format "policy_kind=\\{policy_kind}". + # + # If String is empty, bindings bound to all kinds of policies would be + # returned. + # + # The only supported values are the following: + # + # * "policy_kind=PRINCIPAL_ACCESS_BOUNDARY", + # * "policy_kind=ACCESS" + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PolicyBindings::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new + # + # # Call the search_target_policy_bindings method. + # result = client.search_target_policy_bindings 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::Iam::V3beta::PolicyBinding. + # p item + # end + # + def search_target_policy_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest + + # 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.search_target_policy_bindings.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::Iam::V3beta::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.search_target_policy_bindings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_target_policy_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_bindings_stub.search_target_policy_bindings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @policy_bindings_stub, :search_target_policy_bindings, "policy_bindings", 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 + + ## + # Configuration class for the PolicyBindings REST API. + # + # This class represents the configuration for PolicyBindings REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Iam::V3beta::PolicyBindings::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_policy_binding to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::V3beta::PolicyBindings::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_policy_binding.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_policy_binding.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "iam.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the PolicyBindings API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_policy_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_policy_binding + ## + # RPC-specific configuration for `get_policy_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_policy_binding + ## + # RPC-specific configuration for `update_policy_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_policy_binding + ## + # RPC-specific configuration for `delete_policy_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_policy_binding + ## + # RPC-specific configuration for `list_policy_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_policy_bindings + ## + # RPC-specific configuration for `search_target_policy_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :search_target_policy_bindings + + # @private + def initialize parent_rpcs = nil + create_policy_binding_config = parent_rpcs.create_policy_binding if parent_rpcs.respond_to? :create_policy_binding + @create_policy_binding = ::Gapic::Config::Method.new create_policy_binding_config + get_policy_binding_config = parent_rpcs.get_policy_binding if parent_rpcs.respond_to? :get_policy_binding + @get_policy_binding = ::Gapic::Config::Method.new get_policy_binding_config + update_policy_binding_config = parent_rpcs.update_policy_binding if parent_rpcs.respond_to? :update_policy_binding + @update_policy_binding = ::Gapic::Config::Method.new update_policy_binding_config + delete_policy_binding_config = parent_rpcs.delete_policy_binding if parent_rpcs.respond_to? :delete_policy_binding + @delete_policy_binding = ::Gapic::Config::Method.new delete_policy_binding_config + list_policy_bindings_config = parent_rpcs.list_policy_bindings if parent_rpcs.respond_to? :list_policy_bindings + @list_policy_bindings = ::Gapic::Config::Method.new list_policy_bindings_config + search_target_policy_bindings_config = parent_rpcs.search_target_policy_bindings if parent_rpcs.respond_to? :search_target_policy_bindings + @search_target_policy_bindings = ::Gapic::Config::Method.new search_target_policy_bindings_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/operations.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/operations.rb new file mode 100644 index 000000000000..560ac8beaffb --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/operations.rb @@ -0,0 +1,937 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Iam + module V3beta + module PolicyBindings + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the PolicyBindings Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the PolicyBindings Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "iam.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.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_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + 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 cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/service_stub.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/service_stub.rb new file mode 100644 index 000000000000..ce126e354617 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/service_stub.rb @@ -0,0 +1,535 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/iam/v3beta/policy_bindings_service_pb" + +module Google + module Iam + module V3beta + module PolicyBindings + module Rest + ## + # REST service stub for the PolicyBindings 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 create_policy_binding REST call + # + # @param request_pb [::Google::Iam::V3beta::CreatePolicyBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_policy_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_policy_binding_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_policy_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_policy_binding REST call + # + # @param request_pb [::Google::Iam::V3beta::GetPolicyBindingRequest] + # 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::V3beta::PolicyBinding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V3beta::PolicyBinding] + # A result object deserialized from the server's reply + def get_policy_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_policy_binding_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_policy_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V3beta::PolicyBinding.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_policy_binding REST call + # + # @param request_pb [::Google::Iam::V3beta::UpdatePolicyBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_policy_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_policy_binding_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_policy_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_policy_binding REST call + # + # @param request_pb [::Google::Iam::V3beta::DeletePolicyBindingRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_policy_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_policy_binding_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_policy_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_policy_bindings REST call + # + # @param request_pb [::Google::Iam::V3beta::ListPolicyBindingsRequest] + # 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::V3beta::ListPolicyBindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V3beta::ListPolicyBindingsResponse] + # A result object deserialized from the server's reply + def list_policy_bindings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_policy_bindings_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_policy_bindings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V3beta::ListPolicyBindingsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_target_policy_bindings REST call + # + # @param request_pb [::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest] + # 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::V3beta::SearchTargetPolicyBindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V3beta::SearchTargetPolicyBindingsResponse] + # A result object deserialized from the server's reply + def search_target_policy_bindings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_target_policy_bindings_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: "search_target_policy_bindings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V3beta::SearchTargetPolicyBindingsResponse.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 create_policy_binding REST call + # + # @param request_pb [::Google::Iam::V3beta::CreatePolicyBindingRequest] + # 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_policy_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3beta/{parent}/policyBindings", + body: "policy_binding", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3beta/{parent}/policyBindings", + body: "policy_binding", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :post, + uri_template: "/v3beta/{parent}/policyBindings", + body: "policy_binding", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_policy_binding REST call + # + # @param request_pb [::Google::Iam::V3beta::GetPolicyBindingRequest] + # 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_policy_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_policy_binding REST call + # + # @param request_pb [::Google::Iam::V3beta::UpdatePolicyBindingRequest] + # 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_policy_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3beta/{policy_binding.name}", + body: "policy_binding", + matches: [ + ["policy_binding.name", %r{^projects/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v3beta/{policy_binding.name}", + body: "policy_binding", + matches: [ + ["policy_binding.name", %r{^folders/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :patch, + uri_template: "/v3beta/{policy_binding.name}", + body: "policy_binding", + matches: [ + ["policy_binding.name", %r{^organizations/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_policy_binding REST call + # + # @param request_pb [::Google::Iam::V3beta::DeletePolicyBindingRequest] + # 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_policy_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :delete, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_policy_bindings REST call + # + # @param request_pb [::Google::Iam::V3beta::ListPolicyBindingsRequest] + # 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_policy_bindings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{parent}/policyBindings", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{parent}/policyBindings", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{parent}/policyBindings", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_target_policy_bindings REST call + # + # @param request_pb [::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_target_policy_bindings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{parent}/policyBindings:searchTargetPolicyBindings", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{parent}/policyBindings:searchTargetPolicyBindings", + matches: [ + ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{parent}/policyBindings:searchTargetPolicyBindings", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_pb.rb new file mode 100644 index 000000000000..6c9513bee8e7 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_pb.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/v3beta/policy_bindings_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/iam/v3beta/operation_metadata_pb' +require 'google/iam/v3beta/policy_binding_resources_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n/google/iam/v3beta/policy_bindings_service.proto\x12\x11google.iam.v3beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/iam/v3beta/operation_metadata.proto\x1a\x30google/iam/v3beta/policy_binding_resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xd1\x01\n\x1a\x43reatePolicyBindingRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 iam.googleapis.com/PolicyBinding\x12\x1e\n\x11policy_binding_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12=\n\x0epolicy_binding\x18\x03 \x01(\x0b\x32 .google.iam.v3beta.PolicyBindingB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"Q\n\x17GetPolicyBindingRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n iam.googleapis.com/PolicyBinding\"\xad\x01\n\x1aUpdatePolicyBindingRequest\x12=\n\x0epolicy_binding\x18\x01 \x01(\x0b\x32 .google.iam.v3beta.PolicyBindingB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x83\x01\n\x1a\x44\x65letePolicyBindingRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n iam.googleapis.com/PolicyBinding\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x9b\x01\n\x19ListPolicyBindingsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 iam.googleapis.com/PolicyBinding\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\"u\n\x1aListPolicyBindingsResponse\x12\x39\n\x0fpolicy_bindings\x18\x01 \x03(\x0b\x32 .google.iam.v3beta.PolicyBinding\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb8\x01\n!SearchTargetPolicyBindingsRequest\x12\x13\n\x06target\x18\x01 \x01(\tB\x03\xe0\x41\x02\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\x38\n\x06parent\x18\x05 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 iam.googleapis.com/PolicyBinding\x12\x13\n\x06\x66ilter\x18\x06 \x01(\tB\x03\xe0\x41\x01\"}\n\"SearchTargetPolicyBindingsResponse\x12\x39\n\x0fpolicy_bindings\x18\x01 \x03(\x0b\x32 .google.iam.v3beta.PolicyBinding\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x32\x8c\x12\n\x0ePolicyBindings\x12\x9c\x03\n\x13\x43reatePolicyBinding\x12-.google.iam.v3beta.CreatePolicyBindingRequest\x1a\x1d.google.longrunning.Operation\"\xb6\x02\xca\x41\"\n\rPolicyBinding\x12\x11OperationMetadata\xda\x41\'parent,policy_binding,policy_binding_id\x82\xd3\xe4\x93\x02\xe0\x01\"6/v3beta/{parent=projects/*/locations/*}/policyBindings:\x0epolicy_bindingZG\"5/v3beta/{parent=folders/*/locations/*}/policyBindings:\x0epolicy_bindingZM\";/v3beta/{parent=organizations/*/locations/*}/policyBindings:\x0epolicy_binding\x12\xa1\x02\n\x10GetPolicyBinding\x12*.google.iam.v3beta.GetPolicyBindingRequest\x1a .google.iam.v3beta.PolicyBinding\"\xbe\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xb0\x01\x12\x36/v3beta/{name=projects/*/locations/*/policyBindings/*}Z7\x12\x35/v3beta/{name=folders/*/locations/*/policyBindings/*}Z=\x12;/v3beta/{name=organizations/*/locations/*/policyBindings/*}\x12\xbc\x03\n\x13UpdatePolicyBinding\x12-.google.iam.v3beta.UpdatePolicyBindingRequest\x1a\x1d.google.longrunning.Operation\"\xd6\x02\xca\x41\"\n\rPolicyBinding\x12\x11OperationMetadata\xda\x41\x1apolicy_binding,update_mask\x82\xd3\xe4\x93\x02\x8d\x02\x32\x45/v3beta/{policy_binding.name=projects/*/locations/*/policyBindings/*}:\x0epolicy_bindingZV2D/v3beta/{policy_binding.name=folders/*/locations/*/policyBindings/*}:\x0epolicy_bindingZ\\2J/v3beta/{policy_binding.name=organizations/*/locations/*/policyBindings/*}:\x0epolicy_binding\x12\xd1\x02\n\x13\x44\x65letePolicyBinding\x12-.google.iam.v3beta.DeletePolicyBindingRequest\x1a\x1d.google.longrunning.Operation\"\xeb\x01\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\xb0\x01*6/v3beta/{name=projects/*/locations/*/policyBindings/*}Z7*5/v3beta/{name=folders/*/locations/*/policyBindings/*}Z=*;/v3beta/{name=organizations/*/locations/*/policyBindings/*}\x12\xb4\x02\n\x12ListPolicyBindings\x12,.google.iam.v3beta.ListPolicyBindingsRequest\x1a-.google.iam.v3beta.ListPolicyBindingsResponse\"\xc0\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xb0\x01\x12\x36/v3beta/{parent=projects/*/locations/*}/policyBindingsZ7\x12\x35/v3beta/{parent=folders/*/locations/*}/policyBindingsZ=\x12;/v3beta/{parent=organizations/*/locations/*}/policyBindings\x12\xa4\x03\n\x1aSearchTargetPolicyBindings\x12\x34.google.iam.v3beta.SearchTargetPolicyBindingsRequest\x1a\x35.google.iam.v3beta.SearchTargetPolicyBindingsResponse\"\x98\x02\xda\x41\rparent,target\x82\xd3\xe4\x93\x02\x81\x02\x12Q/v3beta/{parent=projects/*/locations/*}/policyBindings:searchTargetPolicyBindingsZR\x12P/v3beta/{parent=folders/*/locations/*}/policyBindings:searchTargetPolicyBindingsZX\x12V/v3beta/{parent=organizations/*/locations/*}/policyBindings:searchTargetPolicyBindings\x1a\x46\xca\x41\x12iam.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc4\x02\n\x15\x63om.google.iam.v3betaB\x1aPolicyBindingsServiceProtoP\x01Z-cloud.google.com/go/iam/apiv3beta/iampb;iampb\xaa\x02\x17Google.Cloud.Iam.V3Beta\xca\x02\x17Google\\Cloud\\Iam\\V3beta\xea\x41\\\n\'iam.googleapis.com/OrganizationLocation\x12\x31organizations/{organization}/locations/{location}\xea\x41J\n!iam.googleapis.com/FolderLocation\x12%folders/{folder}/locations/{location}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module V3beta + CreatePolicyBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.CreatePolicyBindingRequest").msgclass + GetPolicyBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.GetPolicyBindingRequest").msgclass + UpdatePolicyBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.UpdatePolicyBindingRequest").msgclass + DeletePolicyBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.DeletePolicyBindingRequest").msgclass + ListPolicyBindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.ListPolicyBindingsRequest").msgclass + ListPolicyBindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.ListPolicyBindingsResponse").msgclass + SearchTargetPolicyBindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.SearchTargetPolicyBindingsRequest").msgclass + SearchTargetPolicyBindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.SearchTargetPolicyBindingsResponse").msgclass + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_services_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_services_pb.rb new file mode 100644 index 000000000000..3261714f198e --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_services_pb.rb @@ -0,0 +1,61 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/iam/v3beta/policy_bindings_service.proto for package 'google.iam.v3beta' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/iam/v3beta/policy_bindings_service_pb' + +module Google + module Iam + module V3beta + module PolicyBindings + # An interface for managing Identity and Access Management (IAM) policy + # bindings. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.iam.v3beta.PolicyBindings' + + # Creates a policy binding and returns a long-running operation. + # Callers will need the IAM permissions on both the policy and target. + # After the binding is created, the policy is applied to the target. + rpc :CreatePolicyBinding, ::Google::Iam::V3beta::CreatePolicyBindingRequest, ::Google::Longrunning::Operation + # Gets a policy binding. + rpc :GetPolicyBinding, ::Google::Iam::V3beta::GetPolicyBindingRequest, ::Google::Iam::V3beta::PolicyBinding + # Updates a policy binding and returns a long-running operation. + # Callers will need the IAM permissions on the policy and target in the + # binding to update. Target and policy are immutable and cannot be updated. + rpc :UpdatePolicyBinding, ::Google::Iam::V3beta::UpdatePolicyBindingRequest, ::Google::Longrunning::Operation + # Deletes a policy binding and returns a long-running operation. + # Callers will need the IAM permissions on both the policy and target. + # After the binding is deleted, the policy no longer applies to the target. + rpc :DeletePolicyBinding, ::Google::Iam::V3beta::DeletePolicyBindingRequest, ::Google::Longrunning::Operation + # Lists policy bindings. + rpc :ListPolicyBindings, ::Google::Iam::V3beta::ListPolicyBindingsRequest, ::Google::Iam::V3beta::ListPolicyBindingsResponse + # Search policy bindings by target. Returns all policy binding objects bound + # directly to target. + rpc :SearchTargetPolicyBindings, ::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest, ::Google::Iam::V3beta::SearchTargetPolicyBindingsResponse + end + + Stub = Service.rpc_stub_class + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies.rb new file mode 100644 index 000000000000..40f474975ea8 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v3beta/version" + +require "google/iam/v3beta/principal_access_boundary_policies/credentials" +require "google/iam/v3beta/principal_access_boundary_policies/paths" +require "google/iam/v3beta/principal_access_boundary_policies/operations" +require "google/iam/v3beta/principal_access_boundary_policies/client" +require "google/iam/v3beta/principal_access_boundary_policies/rest" + +module Google + module Iam + module V3beta + ## + # Manages Identity and Access Management (IAM) principal access boundary + # policies. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/iam/v3beta/principal_access_boundary_policies" + # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/iam/v3beta/principal_access_boundary_policies/rest" + # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new + # + module PrincipalAccessBoundaryPolicies + end + end + end +end + +helper_path = ::File.join __dir__, "principal_access_boundary_policies", "helpers.rb" +require "google/iam/v3beta/principal_access_boundary_policies/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/client.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/client.rb new file mode 100644 index 000000000000..3c04a3c916ce --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/client.rb @@ -0,0 +1,1100 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/iam/v3beta/principal_access_boundary_policies_service_pb" +require "google/cloud/location" + +module Google + module Iam + module V3beta + module PrincipalAccessBoundaryPolicies + ## + # Client for the PrincipalAccessBoundaryPolicies service. + # + # Manages Identity and Access Management (IAM) principal access boundary + # policies. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :principal_access_boundary_policies_stub + + ## + # Configure the PrincipalAccessBoundaryPolicies Client class. + # + # See {::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PrincipalAccessBoundaryPolicies clients + # ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Iam", "V3beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_principal_access_boundary_policy.timeout = 30.0 + + default_config.rpcs.get_principal_access_boundary_policy.timeout = 60.0 + default_config.rpcs.get_principal_access_boundary_policy.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_principal_access_boundary_policy.timeout = 30.0 + + default_config.rpcs.delete_principal_access_boundary_policy.timeout = 30.0 + + default_config.rpcs.list_principal_access_boundary_policies.timeout = 60.0 + default_config.rpcs.list_principal_access_boundary_policies.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_principal_access_boundary_policy_bindings.timeout = 60.0 + default_config.rpcs.search_principal_access_boundary_policy_bindings.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PrincipalAccessBoundaryPolicies Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::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 + @principal_access_boundary_policies_stub.universe_domain + end + + ## + # Create a new PrincipalAccessBoundaryPolicies client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PrincipalAccessBoundaryPolicies client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/iam/v3beta/principal_access_boundary_policies_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 + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @principal_access_boundary_policies_stub = ::Gapic::ServiceStub.new( + ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::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 + ) + + @principal_access_boundary_policies_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 = @principal_access_boundary_policies_stub.endpoint + config.universe_domain = @principal_access_boundary_policies_stub.universe_domain + config.logger = @principal_access_boundary_policies_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @principal_access_boundary_policies_stub.logger + end + + # Service calls + + ## + # Creates a principal access boundary policy, and returns a long running + # operation. + # + # @overload create_principal_access_boundary_policy(request, options = nil) + # Pass arguments to `create_principal_access_boundary_policy` via a request object, either of type + # {::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest, ::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_principal_access_boundary_policy(parent: nil, principal_access_boundary_policy_id: nil, principal_access_boundary_policy: nil, validate_only: nil) + # Pass arguments to `create_principal_access_boundary_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 parent [::String] + # Required. The parent resource where this principal access boundary policy + # will be created. Only organizations are supported. + # + # Format: + # `organizations/{organization_id}/locations/{location}` + # @param principal_access_boundary_policy_id [::String] + # Required. The ID to use for the principal access boundary policy, which + # will become the final component of the principal access boundary policy's + # resource name. + # + # This value must start with a lowercase letter followed by up to 62 + # lowercase letters, numbers, hyphens, or dots. Pattern, + # /[a-z][a-z0-9-\.]\\{2,62}/. + # @param principal_access_boundary_policy [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy, ::Hash] + # Required. The principal access boundary policy to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the creation, but do not + # actually post it. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest.new + # + # # Call the create_principal_access_boundary_policy method. + # result = client.create_principal_access_boundary_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_principal_access_boundary_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest + + # 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_principal_access_boundary_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::Iam::V3beta::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_principal_access_boundary_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_principal_access_boundary_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @principal_access_boundary_policies_stub.call_rpc :create_principal_access_boundary_policy, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets a principal access boundary policy. + # + # @overload get_principal_access_boundary_policy(request, options = nil) + # Pass arguments to `get_principal_access_boundary_policy` via a request object, either of type + # {::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest, ::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_principal_access_boundary_policy(name: nil) + # Pass arguments to `get_principal_access_boundary_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 name [::String] + # Required. The name of the principal access boundary policy to retrieve. + # + # Format: + # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest.new + # + # # Call the get_principal_access_boundary_policy method. + # result = client.get_principal_access_boundary_policy request + # + # # The returned object is of type Google::Iam::V3beta::PrincipalAccessBoundaryPolicy. + # p result + # + def get_principal_access_boundary_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest + + # 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_principal_access_boundary_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::Iam::V3beta::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_principal_access_boundary_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_principal_access_boundary_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @principal_access_boundary_policies_stub.call_rpc :get_principal_access_boundary_policy, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a principal access boundary policy. + # + # @overload update_principal_access_boundary_policy(request, options = nil) + # Pass arguments to `update_principal_access_boundary_policy` via a request object, either of type + # {::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest, ::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_principal_access_boundary_policy(principal_access_boundary_policy: nil, validate_only: nil, update_mask: nil) + # Pass arguments to `update_principal_access_boundary_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 principal_access_boundary_policy [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy, ::Hash] + # Required. The principal access boundary policy to update. + # + # The principal access boundary policy's `name` field is used to identify the + # policy to update. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the update, but do not + # actually post it. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The list of fields to update + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest.new + # + # # Call the update_principal_access_boundary_policy method. + # result = client.update_principal_access_boundary_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_principal_access_boundary_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest + + # 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_principal_access_boundary_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::Iam::V3beta::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.principal_access_boundary_policy&.name + header_params["principal_access_boundary_policy.name"] = request.principal_access_boundary_policy.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_principal_access_boundary_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_principal_access_boundary_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @principal_access_boundary_policies_stub.call_rpc :update_principal_access_boundary_policy, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a principal access boundary policy. + # + # @overload delete_principal_access_boundary_policy(request, options = nil) + # Pass arguments to `delete_principal_access_boundary_policy` via a request object, either of type + # {::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest, ::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_principal_access_boundary_policy(name: nil, etag: nil, validate_only: nil, force: nil) + # Pass arguments to `delete_principal_access_boundary_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 name [::String] + # Required. The name of the principal access boundary policy to delete. + # + # Format: + # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` + # @param etag [::String] + # Optional. The etag of the principal access boundary policy. + # If this is provided, it must match the server's etag. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the deletion, but do not + # actually post it. + # @param force [::Boolean] + # Optional. If set to true, the request will force the deletion of the policy + # even if the policy is referenced in policy bindings. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest.new + # + # # Call the delete_principal_access_boundary_policy method. + # result = client.delete_principal_access_boundary_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_principal_access_boundary_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest + + # 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_principal_access_boundary_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::Iam::V3beta::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_principal_access_boundary_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_principal_access_boundary_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @principal_access_boundary_policies_stub.call_rpc :delete_principal_access_boundary_policy, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists principal access boundary policies. + # + # @overload list_principal_access_boundary_policies(request, options = nil) + # Pass arguments to `list_principal_access_boundary_policies` via a request object, either of type + # {::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest, ::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_principal_access_boundary_policies(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_principal_access_boundary_policies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource, which owns the collection of principal + # access boundary policies. + # + # Format: + # `organizations/{organization_id}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of principal access boundary policies to + # return. The service may return fewer than this value. + # + # If unspecified, at most 50 principal access boundary policies will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `ListPrincipalAccessBoundaryPolicies` must match the call that provided the + # page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest.new + # + # # Call the list_principal_access_boundary_policies method. + # result = client.list_principal_access_boundary_policies 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::Iam::V3beta::PrincipalAccessBoundaryPolicy. + # p item + # end + # + def list_principal_access_boundary_policies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest + + # 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_principal_access_boundary_policies.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::Iam::V3beta::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_principal_access_boundary_policies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_principal_access_boundary_policies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @principal_access_boundary_policies_stub.call_rpc :list_principal_access_boundary_policies, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @principal_access_boundary_policies_stub, :list_principal_access_boundary_policies, request, response, operation, options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns all policy bindings that bind a specific policy if a user has + # searchPolicyBindings permission on that policy. + # + # @overload search_principal_access_boundary_policy_bindings(request, options = nil) + # Pass arguments to `search_principal_access_boundary_policy_bindings` via a request object, either of type + # {::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest, ::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 search_principal_access_boundary_policy_bindings(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_principal_access_boundary_policy_bindings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the principal access boundary policy. + # Format: + # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` + # @param page_size [::Integer] + # Optional. The maximum number of policy bindings to return. The service may + # return fewer than this value. + # + # If unspecified, at most 50 policy bindings will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to + # retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call + # that provided the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest.new + # + # # Call the search_principal_access_boundary_policy_bindings method. + # result = client.search_principal_access_boundary_policy_bindings 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::Iam::V3beta::PolicyBinding. + # p item + # end + # + def search_principal_access_boundary_policy_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest + + # 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.search_principal_access_boundary_policy_bindings.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::Iam::V3beta::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.search_principal_access_boundary_policy_bindings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_principal_access_boundary_policy_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @principal_access_boundary_policies_stub.call_rpc :search_principal_access_boundary_policy_bindings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @principal_access_boundary_policies_stub, :search_principal_access_boundary_policy_bindings, 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 + + ## + # Configuration class for the PrincipalAccessBoundaryPolicies API. + # + # This class represents the configuration for PrincipalAccessBoundaryPolicies, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_principal_access_boundary_policy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_principal_access_boundary_policy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_principal_access_boundary_policy.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "iam.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 PrincipalAccessBoundaryPolicies API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_principal_access_boundary_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :create_principal_access_boundary_policy + ## + # RPC-specific configuration for `get_principal_access_boundary_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_principal_access_boundary_policy + ## + # RPC-specific configuration for `update_principal_access_boundary_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :update_principal_access_boundary_policy + ## + # RPC-specific configuration for `delete_principal_access_boundary_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_principal_access_boundary_policy + ## + # RPC-specific configuration for `list_principal_access_boundary_policies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_principal_access_boundary_policies + ## + # RPC-specific configuration for `search_principal_access_boundary_policy_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :search_principal_access_boundary_policy_bindings + + # @private + def initialize parent_rpcs = nil + create_principal_access_boundary_policy_config = parent_rpcs.create_principal_access_boundary_policy if parent_rpcs.respond_to? :create_principal_access_boundary_policy + @create_principal_access_boundary_policy = ::Gapic::Config::Method.new create_principal_access_boundary_policy_config + get_principal_access_boundary_policy_config = parent_rpcs.get_principal_access_boundary_policy if parent_rpcs.respond_to? :get_principal_access_boundary_policy + @get_principal_access_boundary_policy = ::Gapic::Config::Method.new get_principal_access_boundary_policy_config + update_principal_access_boundary_policy_config = parent_rpcs.update_principal_access_boundary_policy if parent_rpcs.respond_to? :update_principal_access_boundary_policy + @update_principal_access_boundary_policy = ::Gapic::Config::Method.new update_principal_access_boundary_policy_config + delete_principal_access_boundary_policy_config = parent_rpcs.delete_principal_access_boundary_policy if parent_rpcs.respond_to? :delete_principal_access_boundary_policy + @delete_principal_access_boundary_policy = ::Gapic::Config::Method.new delete_principal_access_boundary_policy_config + list_principal_access_boundary_policies_config = parent_rpcs.list_principal_access_boundary_policies if parent_rpcs.respond_to? :list_principal_access_boundary_policies + @list_principal_access_boundary_policies = ::Gapic::Config::Method.new list_principal_access_boundary_policies_config + search_principal_access_boundary_policy_bindings_config = parent_rpcs.search_principal_access_boundary_policy_bindings if parent_rpcs.respond_to? :search_principal_access_boundary_policy_bindings + @search_principal_access_boundary_policy_bindings = ::Gapic::Config::Method.new search_principal_access_boundary_policy_bindings_config + + yield self if block_given? + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/credentials.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/credentials.rb new file mode 100644 index 000000000000..faa2a134d021 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/credentials.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 "googleauth" + +module Google + module Iam + module V3beta + module PrincipalAccessBoundaryPolicies + # Credentials for the PrincipalAccessBoundaryPolicies API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/operations.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/operations.rb new file mode 100644 index 000000000000..c490d81cb3c9 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/operations.rb @@ -0,0 +1,839 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Iam + module V3beta + module PrincipalAccessBoundaryPolicies + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the PrincipalAccessBoundaryPolicies Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the PrincipalAccessBoundaryPolicies Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + channel_args: @config.channel_args, + interceptors: @config.interceptors, + channel_pool_config: @config.channel_pool + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION + metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + throw :response, response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # + # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials + # is deprecated. Providing an unvalidated credential configuration to + # Google APIs can compromise the security of your systems and data. + # + # @example + # + # # The recommended way to provide credentials is to use the `make_creds` method + # # on the appropriate credentials class for your environment. + # + # require "googleauth" + # + # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( + # json_key_io: ::File.open("/path/to/keyfile.json") + # ) + # + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.credentials = credentials + # end + # + # @note Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "iam.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration for the channel pool + # @return [::Gapic::ServiceStub::ChannelPool::Configuration] + # + def channel_pool + @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/paths.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/paths.rb new file mode 100644 index 000000000000..5c221ecd1178 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/paths.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 V3beta + module PrincipalAccessBoundaryPolicies + # Path helper methods for the PrincipalAccessBoundaryPolicies API. + module Paths + ## + # Create a fully-qualified OrganizationLocation resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}` + # + # @param organization [String] + # @param location [String] + # + # @return [::String] + def organization_location_path organization:, location: + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}" + end + + ## + # Create a fully-qualified PrincipalAccessBoundaryPolicy resource string. + # + # The resource will be in the following format: + # + # `organizations/{organization}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy}` + # + # @param organization [String] + # @param location [String] + # @param principal_access_boundary_policy [String] + # + # @return [::String] + def principal_access_boundary_policy_path organization:, location:, principal_access_boundary_policy: + raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "organizations/#{organization}/locations/#{location}/principalAccessBoundaryPolicies/#{principal_access_boundary_policy}" + end + + extend self + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest.rb new file mode 100644 index 000000000000..f65293fe81ac --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v3beta/version" + +require "google/iam/v3beta/principal_access_boundary_policies/credentials" +require "google/iam/v3beta/principal_access_boundary_policies/paths" +require "google/iam/v3beta/principal_access_boundary_policies/rest/operations" +require "google/iam/v3beta/principal_access_boundary_policies/rest/client" + +module Google + module Iam + module V3beta + ## + # Manages Identity and Access Management (IAM) principal access boundary + # policies. + # + # To load this service and instantiate a REST client: + # + # require "google/iam/v3beta/principal_access_boundary_policies/rest" + # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new + # + module PrincipalAccessBoundaryPolicies + # Client for the REST transport + module Rest + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/iam/v3beta/principal_access_boundary_policies/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/client.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/client.rb new file mode 100644 index 000000000000..d70131af1227 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/client.rb @@ -0,0 +1,1015 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/iam/v3beta/principal_access_boundary_policies_service_pb" +require "google/iam/v3beta/principal_access_boundary_policies/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Iam + module V3beta + module PrincipalAccessBoundaryPolicies + module Rest + ## + # REST client for the PrincipalAccessBoundaryPolicies service. + # + # Manages Identity and Access Management (IAM) principal access boundary + # policies. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :principal_access_boundary_policies_stub + + ## + # Configure the PrincipalAccessBoundaryPolicies Client class. + # + # See {::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PrincipalAccessBoundaryPolicies clients + # ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Iam", "V3beta"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.rpcs.create_principal_access_boundary_policy.timeout = 30.0 + + default_config.rpcs.get_principal_access_boundary_policy.timeout = 60.0 + default_config.rpcs.get_principal_access_boundary_policy.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_principal_access_boundary_policy.timeout = 30.0 + + default_config.rpcs.delete_principal_access_boundary_policy.timeout = 30.0 + + default_config.rpcs.list_principal_access_boundary_policies.timeout = 60.0 + default_config.rpcs.list_principal_access_boundary_policies.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.search_principal_access_boundary_policy_bindings.timeout = 60.0 + default_config.rpcs.search_principal_access_boundary_policy_bindings.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PrincipalAccessBoundaryPolicies Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::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 + @principal_access_boundary_policies_stub.universe_domain + end + + ## + # Create a new PrincipalAccessBoundaryPolicies REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PrincipalAccessBoundaryPolicies client. + # @yieldparam config [Client::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint.nil? || + (@config.endpoint == Configuration::DEFAULT_ENDPOINT && + !@config.endpoint.split(".").first.include?("-")) + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + config.universe_domain = @config.universe_domain + end + + @principal_access_boundary_policies_stub = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @principal_access_boundary_policies_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 = @principal_access_boundary_policies_stub.endpoint + config.universe_domain = @principal_access_boundary_policies_stub.universe_domain + config.logger = @principal_access_boundary_policies_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Rest::Client] + # + attr_reader :location_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @principal_access_boundary_policies_stub.logger + end + + # Service calls + + ## + # Creates a principal access boundary policy, and returns a long running + # operation. + # + # @overload create_principal_access_boundary_policy(request, options = nil) + # Pass arguments to `create_principal_access_boundary_policy` via a request object, either of type + # {::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest, ::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_principal_access_boundary_policy(parent: nil, principal_access_boundary_policy_id: nil, principal_access_boundary_policy: nil, validate_only: nil) + # Pass arguments to `create_principal_access_boundary_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 parent [::String] + # Required. The parent resource where this principal access boundary policy + # will be created. Only organizations are supported. + # + # Format: + # `organizations/{organization_id}/locations/{location}` + # @param principal_access_boundary_policy_id [::String] + # Required. The ID to use for the principal access boundary policy, which + # will become the final component of the principal access boundary policy's + # resource name. + # + # This value must start with a lowercase letter followed by up to 62 + # lowercase letters, numbers, hyphens, or dots. Pattern, + # /[a-z][a-z0-9-\.]\\{2,62}/. + # @param principal_access_boundary_policy [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy, ::Hash] + # Required. The principal access boundary policy to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the creation, but do not + # actually post it. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest.new + # + # # Call the create_principal_access_boundary_policy method. + # result = client.create_principal_access_boundary_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def create_principal_access_boundary_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest + + # 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_principal_access_boundary_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::Iam::V3beta::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_principal_access_boundary_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_principal_access_boundary_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @principal_access_boundary_policies_stub.create_principal_access_boundary_policy request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: 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 a principal access boundary policy. + # + # @overload get_principal_access_boundary_policy(request, options = nil) + # Pass arguments to `get_principal_access_boundary_policy` via a request object, either of type + # {::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest, ::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_principal_access_boundary_policy(name: nil) + # Pass arguments to `get_principal_access_boundary_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 name [::String] + # Required. The name of the principal access boundary policy to retrieve. + # + # Format: + # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest.new + # + # # Call the get_principal_access_boundary_policy method. + # result = client.get_principal_access_boundary_policy request + # + # # The returned object is of type Google::Iam::V3beta::PrincipalAccessBoundaryPolicy. + # p result + # + def get_principal_access_boundary_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest + + # 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_principal_access_boundary_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::Iam::V3beta::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_principal_access_boundary_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_principal_access_boundary_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @principal_access_boundary_policies_stub.get_principal_access_boundary_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 + + ## + # Updates a principal access boundary policy. + # + # @overload update_principal_access_boundary_policy(request, options = nil) + # Pass arguments to `update_principal_access_boundary_policy` via a request object, either of type + # {::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest, ::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_principal_access_boundary_policy(principal_access_boundary_policy: nil, validate_only: nil, update_mask: nil) + # Pass arguments to `update_principal_access_boundary_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 principal_access_boundary_policy [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy, ::Hash] + # Required. The principal access boundary policy to update. + # + # The principal access boundary policy's `name` field is used to identify the + # policy to update. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the update, but do not + # actually post it. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. The list of fields to update + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest.new + # + # # Call the update_principal_access_boundary_policy method. + # result = client.update_principal_access_boundary_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def update_principal_access_boundary_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest + + # 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_principal_access_boundary_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::Iam::V3beta::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_principal_access_boundary_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_principal_access_boundary_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @principal_access_boundary_policies_stub.update_principal_access_boundary_policy request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a principal access boundary policy. + # + # @overload delete_principal_access_boundary_policy(request, options = nil) + # Pass arguments to `delete_principal_access_boundary_policy` via a request object, either of type + # {::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest, ::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_principal_access_boundary_policy(name: nil, etag: nil, validate_only: nil, force: nil) + # Pass arguments to `delete_principal_access_boundary_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 name [::String] + # Required. The name of the principal access boundary policy to delete. + # + # Format: + # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` + # @param etag [::String] + # Optional. The etag of the principal access boundary policy. + # If this is provided, it must match the server's etag. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the deletion, but do not + # actually post it. + # @param force [::Boolean] + # Optional. If set to true, the request will force the deletion of the policy + # even if the policy is referenced in policy bindings. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest.new + # + # # Call the delete_principal_access_boundary_policy method. + # result = client.delete_principal_access_boundary_policy request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def delete_principal_access_boundary_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest + + # 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_principal_access_boundary_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::Iam::V3beta::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_principal_access_boundary_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_principal_access_boundary_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @principal_access_boundary_policies_stub.delete_principal_access_boundary_policy request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists principal access boundary policies. + # + # @overload list_principal_access_boundary_policies(request, options = nil) + # Pass arguments to `list_principal_access_boundary_policies` via a request object, either of type + # {::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest, ::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_principal_access_boundary_policies(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_principal_access_boundary_policies` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource, which owns the collection of principal + # access boundary policies. + # + # Format: + # `organizations/{organization_id}/locations/{location}` + # @param page_size [::Integer] + # Optional. The maximum number of principal access boundary policies to + # return. The service may return fewer than this value. + # + # If unspecified, at most 50 principal access boundary policies will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `ListPrincipalAccessBoundaryPolicies` must match the call that provided the + # page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest.new + # + # # Call the list_principal_access_boundary_policies method. + # result = client.list_principal_access_boundary_policies 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::Iam::V3beta::PrincipalAccessBoundaryPolicy. + # p item + # end + # + def list_principal_access_boundary_policies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest + + # 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_principal_access_boundary_policies.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::Iam::V3beta::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_principal_access_boundary_policies.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_principal_access_boundary_policies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @principal_access_boundary_policies_stub.list_principal_access_boundary_policies request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @principal_access_boundary_policies_stub, :list_principal_access_boundary_policies, "principal_access_boundary_policies", 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 + + ## + # Returns all policy bindings that bind a specific policy if a user has + # searchPolicyBindings permission on that policy. + # + # @overload search_principal_access_boundary_policy_bindings(request, options = nil) + # Pass arguments to `search_principal_access_boundary_policy_bindings` via a request object, either of type + # {::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest, ::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 search_principal_access_boundary_policy_bindings(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_principal_access_boundary_policy_bindings` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the principal access boundary policy. + # Format: + # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` + # @param page_size [::Integer] + # Optional. The maximum number of policy bindings to return. The service may + # return fewer than this value. + # + # If unspecified, at most 50 policy bindings will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous + # `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to + # retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call + # that provided the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v3beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest.new + # + # # Call the search_principal_access_boundary_policy_bindings method. + # result = client.search_principal_access_boundary_policy_bindings 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::Iam::V3beta::PolicyBinding. + # p item + # end + # + def search_principal_access_boundary_policy_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest + + # 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.search_principal_access_boundary_policy_bindings.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::Iam::V3beta::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.search_principal_access_boundary_policy_bindings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_principal_access_boundary_policy_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @principal_access_boundary_policies_stub.search_principal_access_boundary_policy_bindings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @principal_access_boundary_policies_stub, :search_principal_access_boundary_policy_bindings, "policy_bindings", 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 + + ## + # Configuration class for the PrincipalAccessBoundaryPolicies REST API. + # + # This class represents the configuration for PrincipalAccessBoundaryPolicies REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_principal_access_boundary_policy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_principal_access_boundary_policy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_principal_access_boundary_policy.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "iam.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the PrincipalAccessBoundaryPolicies API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_principal_access_boundary_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :create_principal_access_boundary_policy + ## + # RPC-specific configuration for `get_principal_access_boundary_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_principal_access_boundary_policy + ## + # RPC-specific configuration for `update_principal_access_boundary_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :update_principal_access_boundary_policy + ## + # RPC-specific configuration for `delete_principal_access_boundary_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_principal_access_boundary_policy + ## + # RPC-specific configuration for `list_principal_access_boundary_policies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_principal_access_boundary_policies + ## + # RPC-specific configuration for `search_principal_access_boundary_policy_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :search_principal_access_boundary_policy_bindings + + # @private + def initialize parent_rpcs = nil + create_principal_access_boundary_policy_config = parent_rpcs.create_principal_access_boundary_policy if parent_rpcs.respond_to? :create_principal_access_boundary_policy + @create_principal_access_boundary_policy = ::Gapic::Config::Method.new create_principal_access_boundary_policy_config + get_principal_access_boundary_policy_config = parent_rpcs.get_principal_access_boundary_policy if parent_rpcs.respond_to? :get_principal_access_boundary_policy + @get_principal_access_boundary_policy = ::Gapic::Config::Method.new get_principal_access_boundary_policy_config + update_principal_access_boundary_policy_config = parent_rpcs.update_principal_access_boundary_policy if parent_rpcs.respond_to? :update_principal_access_boundary_policy + @update_principal_access_boundary_policy = ::Gapic::Config::Method.new update_principal_access_boundary_policy_config + delete_principal_access_boundary_policy_config = parent_rpcs.delete_principal_access_boundary_policy if parent_rpcs.respond_to? :delete_principal_access_boundary_policy + @delete_principal_access_boundary_policy = ::Gapic::Config::Method.new delete_principal_access_boundary_policy_config + list_principal_access_boundary_policies_config = parent_rpcs.list_principal_access_boundary_policies if parent_rpcs.respond_to? :list_principal_access_boundary_policies + @list_principal_access_boundary_policies = ::Gapic::Config::Method.new list_principal_access_boundary_policies_config + search_principal_access_boundary_policy_bindings_config = parent_rpcs.search_principal_access_boundary_policy_bindings if parent_rpcs.respond_to? :search_principal_access_boundary_policy_bindings + @search_principal_access_boundary_policy_bindings = ::Gapic::Config::Method.new search_principal_access_boundary_policy_bindings_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/operations.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/operations.rb new file mode 100644 index 000000000000..12444ddc3a6e --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/operations.rb @@ -0,0 +1,937 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" + +module Google + module Iam + module V3beta + module PrincipalAccessBoundaryPolicies + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the PrincipalAccessBoundaryPolicies Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the PrincipalAccessBoundaryPolicies Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # The effective universe domain + # + # @return [String] + # + def universe_domain + @operations_stub.universe_domain + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = OperationsServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # @param return_partial_success [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can iterate + # # over elements, and API calls will be issued to fetch pages as needed. + # result.each do |item| + # # Each element is of type ::Google::Longrunning::Operation. + # p item + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.list_operations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use it to + # # check the status of an operation, cancel it, or wait for results. + # # Here is how to wait for a response. + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "No response received." + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.get_operation request, options do |result, operation| + result = ::Gapic::Operation.new result, @operations_client, options: options + yield result, operation if block_given? + throw :response, result + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.delete_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to + # `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + call_metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers + call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, + transports_version_send: [:rest] + + call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? + call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.cancel_operation request, options do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations REST API. + # + # This class represents the configuration for Operations REST, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # A custom service endpoint, as a hostname or hostname:port. The default is + # nil, indicating to use the default endpoint in the current universe domain. + # @return [::String,nil] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) + # * (`nil`) indicating no credentials + # + # Warning: If you accept a credential configuration (JSON file or Hash) from an + # external source for authentication to Google Cloud, you must validate it before + # providing it to a Google API client library. Providing an unvalidated credential + # configuration to Google APIs can compromise the security of your systems and data. + # For more information, refer to [Validate credential configurations from external + # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # @!attribute [rw] universe_domain + # The universe domain within which to make requests. This determines the + # default endpoint URL. The default value of nil uses the environment + # universe (usually the default "googleapis.com" universe). + # @return [::String,nil] + # @!attribute [rw] logger + # A custom logger to use for request/response debug logging, or the value + # `:default` (the default) to construct a default logger, or `nil` to + # explicitly disable logging. + # @return [::Logger,:default,nil] + # + class Configuration + extend ::Gapic::Config + + # @private + # The endpoint specific to the default "googleapis.com" universe. Deprecated. + DEFAULT_ENDPOINT = "iam.googleapis.com" + + config_attr :endpoint, nil, ::String, nil + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + config_attr :universe_domain, nil, ::String, nil + config_attr :logger, :default, ::Logger, nil, :default + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + + yield self if block_given? + end + end + end + end + + ## + # @private + # REST service stub for the Longrunning Operations API. + # Service stub contains baseline method implementations + # including transcoding, making the REST call, and deserialing the response. + class OperationsServiceStub + def initialize endpoint:, endpoint_template:, universe_domain:, credentials: + # These require statements are intentionally placed here to initialize + # the REST modules only when it's required. + require "gapic/rest" + + @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, + endpoint_template: endpoint_template, + universe_domain: universe_domain, + credentials: credentials + end + + ## + # Baseline implementation for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::ListOperationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::ListOperationsResponse] + # A result object deserialized from the server's reply + def list_operations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "list_operations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::ListOperationsResponse.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_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def get_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "get_operation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def delete_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "delete_operation", + 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 cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Protobuf::Empty] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Protobuf::Empty] + # A result object deserialized from the server's reply + def cancel_operation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb + query_string_params = if query_string_params.any? + query_string_params.to_h { |p| p.split "=", 2 } + else + {} + end + + response = @client_stub.make_http_request( + verb, + uri: uri, + body: body || "", + params: query_string_params, + method_name: "cancel_operation", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the list_operations REST call + # + # @param request_pb [::Google::Longrunning::ListOperationsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_list_operations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operation REST call + # + # @param request_pb [::Google::Longrunning::GetOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^folders/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operation REST call + # + # @param request_pb [::Google::Longrunning::DeleteOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_delete_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_operation REST call + # + # @param request_pb [::Google::Longrunning::CancelOperationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_cancel_operation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^operations(?:/.*)?$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/service_stub.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/service_stub.rb new file mode 100644 index 000000000000..e36e1d4e8f56 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/service_stub.rb @@ -0,0 +1,447 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/iam/v3beta/principal_access_boundary_policies_service_pb" + +module Google + module Iam + module V3beta + module PrincipalAccessBoundaryPolicies + module Rest + ## + # REST service stub for the PrincipalAccessBoundaryPolicies 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 create_principal_access_boundary_policy REST call + # + # @param request_pb [::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def create_principal_access_boundary_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_principal_access_boundary_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: "create_principal_access_boundary_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_principal_access_boundary_policy REST call + # + # @param request_pb [::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest] + # 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::V3beta::PrincipalAccessBoundaryPolicy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy] + # A result object deserialized from the server's reply + def get_principal_access_boundary_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_principal_access_boundary_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_principal_access_boundary_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy.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_principal_access_boundary_policy REST call + # + # @param request_pb [::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def update_principal_access_boundary_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_principal_access_boundary_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: "update_principal_access_boundary_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_principal_access_boundary_policy REST call + # + # @param request_pb [::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest] + # A request object representing the call parameters. Required. + # @param options [::Gapic::CallOptions] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Longrunning::Operation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Longrunning::Operation] + # A result object deserialized from the server's reply + def delete_principal_access_boundary_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_principal_access_boundary_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: "delete_principal_access_boundary_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Longrunning::Operation.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_principal_access_boundary_policies REST call + # + # @param request_pb [::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest] + # 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::V3beta::ListPrincipalAccessBoundaryPoliciesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesResponse] + # A result object deserialized from the server's reply + def list_principal_access_boundary_policies request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_principal_access_boundary_policies_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_principal_access_boundary_policies", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_principal_access_boundary_policy_bindings REST call + # + # @param request_pb [::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest] + # 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::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsResponse] + # A result object deserialized from the server's reply + def search_principal_access_boundary_policy_bindings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_principal_access_boundary_policy_bindings_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: "search_principal_access_boundary_policy_bindings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsResponse.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 create_principal_access_boundary_policy REST call + # + # @param request_pb [::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest] + # 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_principal_access_boundary_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v3beta/{parent}/principalAccessBoundaryPolicies", + body: "principal_access_boundary_policy", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_principal_access_boundary_policy REST call + # + # @param request_pb [::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest] + # 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_principal_access_boundary_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/principalAccessBoundaryPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_principal_access_boundary_policy REST call + # + # @param request_pb [::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest] + # 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_principal_access_boundary_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v3beta/{principal_access_boundary_policy.name}", + body: "principal_access_boundary_policy", + matches: [ + ["principal_access_boundary_policy.name", %r{^organizations/[^/]+/locations/[^/]+/principalAccessBoundaryPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_principal_access_boundary_policy REST call + # + # @param request_pb [::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest] + # 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_principal_access_boundary_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v3beta/{name}", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/principalAccessBoundaryPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_principal_access_boundary_policies REST call + # + # @param request_pb [::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest] + # 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_principal_access_boundary_policies_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{parent}/principalAccessBoundaryPolicies", + matches: [ + ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_principal_access_boundary_policy_bindings REST call + # + # @param request_pb [::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_principal_access_boundary_policy_bindings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v3beta/{name}:searchPolicyBindings", + matches: [ + ["name", %r{^organizations/[^/]+/locations/[^/]+/principalAccessBoundaryPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies_service_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies_service_pb.rb new file mode 100644 index 000000000000..ee829930af81 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies_service_pb.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/v3beta/principal_access_boundary_policies_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/iam/v3beta/operation_metadata_pb' +require 'google/iam/v3beta/policy_binding_resources_pb' +require 'google/iam/v3beta/principal_access_boundary_policy_resources_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nBgoogle/iam/v3beta/principal_access_boundary_policies_service.proto\x12\x11google.iam.v3beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/iam/v3beta/operation_metadata.proto\x1a\x30google/iam/v3beta/policy_binding_resources.proto\x1a\x42google/iam/v3beta/principal_access_boundary_policy_resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa5\x02\n*CreatePrincipalAccessBoundaryPolicyRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\x12\x30iam.googleapis.com/PrincipalAccessBoundaryPolicy\x12\x30\n#principal_access_boundary_policy_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12_\n principal_access_boundary_policy\x18\x03 \x01(\x0b\x32\x30.google.iam.v3beta.PrincipalAccessBoundaryPolicyB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"q\n\'GetPrincipalAccessBoundaryPolicyRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0iam.googleapis.com/PrincipalAccessBoundaryPolicy\"\xdf\x01\n*UpdatePrincipalAccessBoundaryPolicyRequest\x12_\n principal_access_boundary_policy\x18\x01 \x01(\x0b\x32\x30.google.iam.v3beta.PrincipalAccessBoundaryPolicyB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\xb7\x01\n*DeletePrincipalAccessBoundaryPolicyRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0iam.googleapis.com/PrincipalAccessBoundaryPolicy\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xa7\x01\n*ListPrincipalAccessBoundaryPoliciesRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\x12\x30iam.googleapis.com/PrincipalAccessBoundaryPolicy\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\"\xa9\x01\n+ListPrincipalAccessBoundaryPoliciesResponse\x12\\\n\"principal_access_boundary_policies\x18\x01 \x03(\x0b\x32\x30.google.iam.v3beta.PrincipalAccessBoundaryPolicy\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xad\x01\n2SearchPrincipalAccessBoundaryPolicyBindingsRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0iam.googleapis.com/PrincipalAccessBoundaryPolicy\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x8e\x01\n3SearchPrincipalAccessBoundaryPolicyBindingsResponse\x12\x39\n\x0fpolicy_bindings\x18\x01 \x03(\x0b\x32 .google.iam.v3beta.PolicyBinding\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x32\xa8\x0f\n\x1fPrincipalAccessBoundaryPolicies\x12\xff\x02\n#CreatePrincipalAccessBoundaryPolicy\x12=.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest\x1a\x1d.google.longrunning.Operation\"\xf9\x01\xca\x41\x32\n\x1dPrincipalAccessBoundaryPolicy\x12\x11OperationMetadata\xda\x41Kparent,principal_access_boundary_policy,principal_access_boundary_policy_id\x82\xd3\xe4\x93\x02p\"L/v3beta/{parent=organizations/*/locations/*}/principalAccessBoundaryPolicies: principal_access_boundary_policy\x12\xed\x01\n GetPrincipalAccessBoundaryPolicy\x12:.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest\x1a\x30.google.iam.v3beta.PrincipalAccessBoundaryPolicy\"[\xda\x41\x04name\x82\xd3\xe4\x93\x02N\x12L/v3beta/{name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}\x12\x82\x03\n#UpdatePrincipalAccessBoundaryPolicy\x12=.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest\x1a\x1d.google.longrunning.Operation\"\xfc\x01\xca\x41\x32\n\x1dPrincipalAccessBoundaryPolicy\x12\x11OperationMetadata\xda\x41,principal_access_boundary_policy,update_mask\x82\xd3\xe4\x93\x02\x91\x01\x32m/v3beta/{principal_access_boundary_policy.name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}: principal_access_boundary_policy\x12\x8e\x02\n#DeletePrincipalAccessBoundaryPolicy\x12=.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest\x1a\x1d.google.longrunning.Operation\"\x88\x01\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02N*L/v3beta/{name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}\x12\x83\x02\n#ListPrincipalAccessBoundaryPolicies\x12=.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest\x1a>.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse\"]\xda\x41\x06parent\x82\xd3\xe4\x93\x02N\x12L/v3beta/{parent=organizations/*/locations/*}/principalAccessBoundaryPolicies\x12\xae\x02\n+SearchPrincipalAccessBoundaryPolicyBindings\x12\x45.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest\x1a\x46.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse\"p\xda\x41\x04name\x82\xd3\xe4\x93\x02\x63\x12\x61/v3beta/{name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}:searchPolicyBindings\x1a\x46\xca\x41\x12iam.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa9\x01\n\x15\x63om.google.iam.v3betaB+PrincipalAccessBoundaryPoliciesServiceProtoP\x01Z-cloud.google.com/go/iam/apiv3beta/iampb;iampb\xaa\x02\x17Google.Cloud.Iam.V3Beta\xca\x02\x17Google\\Cloud\\Iam\\V3betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module V3beta + CreatePrincipalAccessBoundaryPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest").msgclass + GetPrincipalAccessBoundaryPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest").msgclass + UpdatePrincipalAccessBoundaryPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest").msgclass + DeletePrincipalAccessBoundaryPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest").msgclass + ListPrincipalAccessBoundaryPoliciesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest").msgclass + ListPrincipalAccessBoundaryPoliciesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse").msgclass + SearchPrincipalAccessBoundaryPolicyBindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest").msgclass + SearchPrincipalAccessBoundaryPolicyBindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse").msgclass + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies_service_services_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies_service_services_pb.rb new file mode 100644 index 000000000000..3789b868b8e2 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies_service_services_pb.rb @@ -0,0 +1,56 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/iam/v3beta/principal_access_boundary_policies_service.proto for package 'google.iam.v3beta' +# Original file comments: +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/iam/v3beta/principal_access_boundary_policies_service_pb' + +module Google + module Iam + module V3beta + module PrincipalAccessBoundaryPolicies + # Manages Identity and Access Management (IAM) principal access boundary + # policies. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.iam.v3beta.PrincipalAccessBoundaryPolicies' + + # Creates a principal access boundary policy, and returns a long running + # operation. + rpc :CreatePrincipalAccessBoundaryPolicy, ::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest, ::Google::Longrunning::Operation + # Gets a principal access boundary policy. + rpc :GetPrincipalAccessBoundaryPolicy, ::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest, ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy + # Updates a principal access boundary policy. + rpc :UpdatePrincipalAccessBoundaryPolicy, ::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest, ::Google::Longrunning::Operation + # Deletes a principal access boundary policy. + rpc :DeletePrincipalAccessBoundaryPolicy, ::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest, ::Google::Longrunning::Operation + # Lists principal access boundary policies. + rpc :ListPrincipalAccessBoundaryPolicies, ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest, ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesResponse + # Returns all policy bindings that bind a specific policy if a user has + # searchPolicyBindings permission on that policy. + rpc :SearchPrincipalAccessBoundaryPolicyBindings, ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest, ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsResponse + end + + Stub = Service.rpc_stub_class + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policy_resources_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policy_resources_pb.rb new file mode 100644 index 000000000000..aeddd8701494 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policy_resources_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/v3beta/principal_access_boundary_policy_resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\nBgoogle/iam/v3beta/principal_access_boundary_policy_resources.proto\x12\x11google.iam.v3beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb5\x05\n\x1dPrincipalAccessBoundaryPolicy\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x18\n\x03uid\x18\x02 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12[\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x41.google.iam.v3beta.PrincipalAccessBoundaryPolicy.AnnotationsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12M\n\x07\x64\x65tails\x18\x08 \x01(\x0b\x32\x37.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetailsB\x03\xe0\x41\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:\xec\x01\xea\x41\xe8\x01\n0iam.googleapis.com/PrincipalAccessBoundaryPolicy\x12torganizations/{organization}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy}*\x1fprincipalAccessBoundaryPolicies2\x1dprincipalAccessBoundaryPolicy\"\x92\x01\n$PrincipalAccessBoundaryPolicyDetails\x12H\n\x05rules\x18\x01 \x03(\x0b\x32\x34.google.iam.v3beta.PrincipalAccessBoundaryPolicyRuleB\x03\xe0\x41\x02\x12 \n\x13\x65nforcement_version\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xd4\x01\n!PrincipalAccessBoundaryPolicyRule\x12\x18\n\x0b\x64\x65scription\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tresources\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12P\n\x06\x65\x66\x66\x65\x63t\x18\x03 \x01(\x0e\x32;.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.EffectB\x03\xe0\x41\x02\"+\n\x06\x45\x66\x66\x65\x63t\x12\x16\n\x12\x45\x46\x46\x45\x43T_UNSPECIFIED\x10\x00\x12\t\n\x05\x41LLOW\x10\x01\x42\xa9\x01\n\x15\x63om.google.iam.v3betaB+PrincipalAccessBoundaryPolicyResourcesProtoP\x01Z-cloud.google.com/go/iam/apiv3beta/iampb;iampb\xaa\x02\x17Google.Cloud.Iam.V3Beta\xca\x02\x17Google\\Cloud\\Iam\\V3betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module V3beta + PrincipalAccessBoundaryPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.PrincipalAccessBoundaryPolicy").msgclass + PrincipalAccessBoundaryPolicyDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails").msgclass + PrincipalAccessBoundaryPolicyRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.PrincipalAccessBoundaryPolicyRule").msgclass + PrincipalAccessBoundaryPolicyRule::Effect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect").enummodule + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/rest.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/rest.rb new file mode 100644 index 000000000000..9397ad516c7c --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/rest.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/iam/v3beta/access_policies/rest" +require "google/iam/v3beta/policy_bindings/rest" +require "google/iam/v3beta/principal_access_boundary_policies/rest" +require "google/cloud/iam/v3beta/version" + +module Google + module Iam + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/iam/v3beta/rest" + # client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new + # + module V3beta + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/README.md b/owl-bot-staging/google-iam-v3beta/proto_docs/README.md new file mode 100644 index 000000000000..536b687b8e98 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/proto_docs/README.md @@ -0,0 +1,4 @@ +# Identity and Access Management (IAM) V3BETA Protocol Buffer Documentation + +These files are for the YARD documentation of the generated protobuf files. +They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/client.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + # @!attribute [rw] selective_gapic_generation + # @return [::Google::Api::SelectiveGapicGeneration] + # Configuration for which RPCs should be generated in the GAPIC client. + # + # 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-iam-v3beta/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/field_info.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Rich semantic information of an API field beyond basic typing. + # @!attribute [rw] format + # @return [::Google::Api::FieldInfo::Format] + # The standard format of a field value. This does not explicitly configure + # any API consumer, just documents the API's format for the field it is + # applied to. + # @!attribute [rw] referenced_types + # @return [::Array<::Google::Api::TypeReference>] + # The type(s) that the annotated, generic field may represent. + # + # Currently, this must only be used on fields of type `google.protobuf.Any`. + # Supporting other generic types may be considered in the future. + class FieldInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The standard format of a field value. The supported formats are all backed + # by either an RFC defined by the IETF or a Google-defined AIP. + module Format + # Default, unspecified value. + FORMAT_UNSPECIFIED = 0 + + # Universally Unique Identifier, version 4, value as defined by + # https://datatracker.ietf.org/doc/html/rfc4122. The value may be + # normalized to entirely lowercase letters. For example, the value + # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to + # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. + UUID4 = 1 + + # Internet Protocol v4 value as defined by [RFC + # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be + # condensed, with leading zeros in each octet stripped. For example, + # `001.022.233.040` would be condensed to `1.22.233.40`. + IPV4 = 2 + + # Internet Protocol v6 value as defined by [RFC + # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be + # normalized to entirely lowercase letters with zeros compressed, following + # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, + # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. + IPV6 = 3 + + # An IP address in either v4 or v6 format as described by the individual + # values defined herein. See the comments on the IPV4 and IPV6 types for + # allowed normalizations of each. + IPV4_OR_IPV6 = 4 + end + end + + # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. + # @!attribute [rw] type_name + # @return [::String] + # The name of the type that the annotated, generic field may represent. + # If the type is in the same protobuf package, the value can be the simple + # message name e.g., `"MyMessage"`. Otherwise, the value must be the + # fully-qualified message name e.g., `"google.library.v1.Book"`. + # + # If the type(s) are unknown to the service (e.g. the field accepts generic + # user input), use the wildcard `"*"` to denote this behavior. + # + # See [AIP-202](https://google.aip.dev/202#type-references) for more details. + class TypeReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/proto_docs/google/api/resource.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/proto_docs/google/iam/v3beta/access_policies_service.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/access_policies_service.rb new file mode 100644 index 000000000000..a8350bf45f46 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/access_policies_service.rb @@ -0,0 +1,203 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 V3beta + # Request message for CreateAccessPolicy method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this access policy will be created. + # + # Format: + # `projects/{project_id}/locations/{location}` + # `projects/{project_number}/locations/{location}` + # `folders/{folder_id}/locations/{location}` + # `organizations/{organization_id}/locations/{location}` + # @!attribute [rw] access_policy_id + # @return [::String] + # Required. The ID to use for the access policy, which + # will become the final component of the access policy's + # resource name. + # + # This value must start with a lowercase letter followed by up to 62 + # lowercase letters, numbers, hyphens, or dots. Pattern, + # /[a-z][a-z0-9-\.]\\{2,62}/. + # + # This value must be unique among all access policies with the same parent. + # @!attribute [rw] access_policy + # @return [::Google::Iam::V3beta::AccessPolicy] + # Required. The access policy to create. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the creation, but do not + # actually post it. + class CreateAccessPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetAccessPolicy method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the access policy to retrieve. + # + # Format: + # `projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}` + # `folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}` + class GetAccessPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateAccessPolicy method. + # @!attribute [rw] access_policy + # @return [::Google::Iam::V3beta::AccessPolicy] + # Required. The access policy to update. + # + # The access policy's `name` field is used to identify the + # policy to update. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the update, but do not + # actually post it. + class UpdateAccessPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteAccessPolicy method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the access policy to delete. + # + # Format: + # `projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}` + # `folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}` + # @!attribute [rw] etag + # @return [::String] + # Optional. The etag of the access policy. If this is provided, it must match + # the server's etag. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the deletion, but do not + # actually post it. + # @!attribute [rw] force + # @return [::Boolean] + # Optional. If set to true, the request will force the deletion of the Policy + # even if the Policy references PolicyBindings. + class DeleteAccessPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListAccessPolicies method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource, which owns the collection of access policy + # resources. + # + # Format: + # `projects/{project_id}/locations/{location}` + # `projects/{project_number}/locations/{location}` + # `folders/{folder_id}/locations/{location}` + # `organizations/{organization_id}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of access policies to return. The + # service may return fewer than this value. + # + # If unspecified, at most 50 access policies will be returned. Valid value + # ranges from 1 to 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous + # `ListAccessPolicies` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `ListAccessPolicies` must match the call that provided the + # page token. + class ListAccessPoliciesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListAccessPolicies method. + # @!attribute [rw] access_policies + # @return [::Array<::Google::Iam::V3beta::AccessPolicy>] + # The access policies from the specified parent. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. A token, which can be sent as `page_token` to retrieve the next + # page. If this field is omitted, there are no subsequent pages. + class ListAccessPoliciesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for SearchAccessPolicyBindings rpc. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the access policy. + # Format: + # `organizations/{organization_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `folders/{folder_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `projects/{project_id}/locations/{location}/accessPolicies/{access_policy_id}` + # `projects/{project_number}/locations/{location}/accessPolicies/{access_policy_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of policy bindings to return. The service may + # return fewer than this value. + # + # If unspecified, at most 50 policy bindings will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous + # `SearchAccessPolicyBindingsRequest` call. Provide this to + # retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `SearchAccessPolicyBindingsRequest` must match the call + # that provided the page token. + class SearchAccessPolicyBindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for SearchAccessPolicyBindings rpc. + # @!attribute [rw] policy_bindings + # @return [::Array<::Google::Iam::V3beta::PolicyBinding>] + # The policy bindings that reference the specified policy. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. A token, which can be sent as `page_token` to retrieve the next + # page. If this field is omitted, there are no subsequent pages. + class SearchAccessPolicyBindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/access_policy_resources.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/access_policy_resources.rb new file mode 100644 index 000000000000..cb77bb996aa9 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/access_policy_resources.rb @@ -0,0 +1,223 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 V3beta + # An IAM access policy resource. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the access policy. + # + # The following formats are supported: + # + # * `projects/{project_id}/locations/{location}/accessPolicies/{policy_id}` + # * `projects/{project_number}/locations/{location}/accessPolicies/{policy_id}` + # * `folders/{folder_id}/locations/{location}/accessPolicies/{policy_id}` + # * `organizations/{organization_id}/locations/{location}/accessPolicies/{policy_id}` + # @!attribute [r] uid + # @return [::String] + # Output only. The globally unique ID of the access policy. + # @!attribute [rw] etag + # @return [::String] + # Optional. The etag for the access policy. + # If this is provided on update, it must match the server's etag. + # @!attribute [rw] display_name + # @return [::String] + # Optional. The description of the access policy. Must be less than + # or equal to 63 characters. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. User defined annotations. See + # https://google.aip.dev/148#annotations for more details such as format and + # size limitations + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the access policy was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the access policy was most recently + # updated. + # @!attribute [rw] details + # @return [::Google::Iam::V3beta::AccessPolicyDetails] + # Optional. The details for the access policy. + class AccessPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Access policy details. + # @!attribute [rw] rules + # @return [::Array<::Google::Iam::V3beta::AccessPolicyRule>] + # Required. A list of access policy rules. + class AccessPolicyDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Access Policy Rule that determines the behavior of the policy. + # @!attribute [rw] description + # @return [::String] + # Optional. Customer specified description of the rule. Must be less than or + # equal to 256 characters. + # @!attribute [rw] effect + # @return [::Google::Iam::V3beta::AccessPolicyRule::Effect] + # Required. The effect of the rule. + # @!attribute [rw] principals + # @return [::Array<::String>] + # Required. The identities for which this rule's effect governs using one or + # more permissions on Google Cloud resources. This field can contain the + # following values: + # + # * `principal://goog/subject/{email_id}`: A specific Google Account. + # Includes Gmail, Cloud Identity, and Google Workspace user accounts. For + # example, `principal://goog/subject/alice@example.com`. + # + # * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`: + # A Google Cloud service account. For example, + # `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`. + # + # * `principalSet://goog/group/{group_id}`: A Google group. For example, + # `principalSet://goog/group/admins@example.com`. + # + # * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the + # principals associated with the specified Google Workspace or Cloud + # Identity customer ID. For example, + # `principalSet://goog/cloudIdentityCustomerId/C01Abc35`. + # + # + # If an identifier that was previously set on a policy is soft deleted, then + # calls to read that policy will return the identifier with a deleted + # prefix. Users cannot set identifiers with this syntax. + # + # * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific + # Google Account that was deleted recently. For example, + # `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If + # the Google Account is recovered, this identifier reverts to the standard + # identifier for a Google Account. + # + # * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group + # that was deleted recently. For example, + # `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. + # If the Google group is restored, this identifier reverts to the standard + # identifier for a Google group. + # + # * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`: + # A Google Cloud service account that was deleted recently. For example, + # `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`. + # If the service account is undeleted, this identifier reverts to the + # standard identifier for a service account. + # @!attribute [rw] excluded_principals + # @return [::Array<::String>] + # Optional. The identities that are excluded from the access policy rule, + # even if they are listed in the `principals`. For example, you could add a + # Google group to the `principals`, then exclude specific users who belong to + # that group. + # @!attribute [rw] operation + # @return [::Google::Iam::V3beta::AccessPolicyRule::Operation] + # Required. Attributes that are used to determine whether this rule applies + # to a request. + # @!attribute [rw] conditions + # @return [::Google::Protobuf::Map{::String => ::Google::Type::Expr}] + # Optional. The conditions that determine whether this rule applies to a + # request. Conditions are identified by their key, which is the FQDN of the + # service that they are relevant to. For example: + # + # ``` + # "conditions": { + # "iam.googleapis.com": { + # "expression": + # } + # } + # ``` + # + # Each rule is evaluated independently. If this rule does not apply + # to a request, other rules might still apply. + # Currently supported keys are as follows: + # + # + # * `eventarc.googleapis.com`: Can use `CEL` functions that evaluate + # resource fields. + # + # * `iam.googleapis.com`: Can use `CEL` functions that evaluate + # [resource + # tags](https://cloud.google.com/iam/help/conditions/resource-tags) and + # combine them using boolean and logical operators. Other functions and + # operators are not supported. + class AccessPolicyRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Attributes that are used to determine whether this rule applies to a + # request. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # Optional. The permissions that are explicitly affected by this rule. Each + # permission uses the format `{service_fqdn}/{resource}.{verb}`, where + # `{service_fqdn}` is the fully qualified domain name for the service. + # Currently supported permissions are as follows: + # + # * `eventarc.googleapis.com/messageBuses.publish`. + # @!attribute [rw] excluded_permissions + # @return [::Array<::String>] + # Optional. Specifies the permissions that this rule excludes from the set + # of affected permissions given by `permissions`. If a permission appears + # in `permissions` _and_ in `excluded_permissions` then it will _not_ be + # subject to the policy effect. + # + # The excluded permissions can be specified using the same syntax as + # `permissions`. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Type::Expr] + class ConditionsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An effect to describe the access relationship. + module Effect + # The effect is unspecified. + EFFECT_UNSPECIFIED = 0 + + # The policy will deny access if it evaluates to true. + DENY = 1 + + # The policy will grant access if it evaluates to true. + ALLOW = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/operation_metadata.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/operation_metadata.rb new file mode 100644 index 000000000000..4e4463d9171f --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/operation_metadata.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 V3beta + # Represents the metadata of the long-running operation. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. Operations that have successfully been cancelled + # have [Operation.error][] value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_binding_resources.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_binding_resources.rb new file mode 100644 index 000000000000..c46446dc0080 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_binding_resources.rb @@ -0,0 +1,193 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 V3beta + # IAM policy binding resource. + # @!attribute [rw] name + # @return [::String] + # Identifier. The name of the policy binding, in the format + # `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`. + # The binding parent is the closest Resource Manager resource (project, + # folder, or organization) to the binding target. + # + # Format: + # + # * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` + # * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` + # * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` + # * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` + # @!attribute [r] uid + # @return [::String] + # Output only. The globally unique ID of the policy binding. Assigned when + # the policy binding is created. + # @!attribute [rw] etag + # @return [::String] + # Optional. The etag for the policy binding. + # If this is provided on update, it must match the server's etag. + # @!attribute [rw] display_name + # @return [::String] + # Optional. The description of the policy binding. Must be less than or equal + # to 63 characters. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. User-defined annotations. See + # https://google.aip.dev/148#annotations for more details such as format and + # size limitations + # @!attribute [rw] target + # @return [::Google::Iam::V3beta::PolicyBinding::Target] + # Required. Immutable. The full resource name of the resource to which the + # policy will be bound. Immutable once set. + # @!attribute [rw] policy_kind + # @return [::Google::Iam::V3beta::PolicyBinding::PolicyKind] + # Immutable. The kind of the policy to attach in this binding. This field + # must be one of the following: + # + # - Left empty (will be automatically set to the policy kind) + # - The input policy kind + # @!attribute [rw] policy + # @return [::String] + # Required. Immutable. The resource name of the policy to be bound. The + # binding parent and policy must belong to the same organization. + # @!attribute [r] policy_uid + # @return [::String] + # Output only. The globally unique ID of the policy to be bound. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # Optional. The condition to apply to the policy binding. When set, the + # `expression` field in the `Expr` must include from 1 to 10 subexpressions, + # joined by the + # "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and + # cannot contain more than 250 characters. + # + # The condition is currently only supported when bound to policies of kind + # principal access boundary. + # + # When the bound policy is a principal access boundary policy, the only + # supported attributes in any subexpression are `principal.type` and + # `principal.subject`. An example expression is: "principal.type == + # 'iam.googleapis.com/ServiceAccount'" or "principal.subject == + # 'bob@example.com'". + # + # Allowed operations for `principal.subject`: + # + # - `principal.subject == ` + # - `principal.subject != ` + # - `principal.subject in []` + # - `principal.subject.startsWith()` + # - `principal.subject.endsWith()` + # + # Allowed operations for `principal.type`: + # + # - `principal.type == ` + # - `principal.type != ` + # - `principal.type in []` + # + # Supported principal types are workspace, workforce pool, workload pool, + # service account, and Agent Identity. Allowed string must be one of: + # + # - `iam.googleapis.com/WorkspaceIdentity` + # - `iam.googleapis.com/WorkforcePoolIdentity` + # - `iam.googleapis.com/WorkloadPoolIdentity` + # - `iam.googleapis.com/ServiceAccount` + # - `iam.googleapis.com/AgentPoolIdentity` (available in Preview) + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy binding was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy binding was most recently updated. + class PolicyBinding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The full resource name of the resource to which the policy will + # be bound. Immutable once set. + # @!attribute [rw] principal_set + # @return [::String] + # Immutable. The full resource name that's used for principal access + # boundary policy bindings. The principal set must be directly parented + # by the policy binding's parent or same as the parent if the target is a + # project, folder, or organization. + # + # Examples: + # + # * For bindings parented by an organization: + # * Organization: + # `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID` + # * Workforce Identity: + # `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID` + # * Workspace Identity: + # `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID` + # * For bindings parented by a folder: + # * Folder: + # `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID` + # * For bindings parented by a project: + # * Project: + # * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER` + # * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID` + # * Workload Identity Pool: + # `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID` + # + # Note: The following fields are mutually exclusive: `principal_set`, `resource`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] resource + # @return [::String] + # Immutable. The full resource name that's used for access policy + # bindings. + # + # Examples: + # + # * Organization: + # `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID` + # * Folder: `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID` + # * Project: + # * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER` + # * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID` + # + # Note: The following fields are mutually exclusive: `resource`, `principal_set`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Target + 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 + + # The different policy kinds supported in this binding. + module PolicyKind + # Unspecified policy kind; Not a valid state + POLICY_KIND_UNSPECIFIED = 0 + + # Principal access boundary policy kind + PRINCIPAL_ACCESS_BOUNDARY = 1 + + # Access policy kind. + ACCESS = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_bindings_service.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_bindings_service.rb new file mode 100644 index 000000000000..4ff232b4471d --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_bindings_service.rb @@ -0,0 +1,243 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 V3beta + # Request message for CreatePolicyBinding method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this policy binding will be created. + # The binding parent is the closest Resource Manager resource (project, + # folder or organization) to the binding target. + # + # Format: + # + # * `projects/{project_id}/locations/{location}` + # * `projects/{project_number}/locations/{location}` + # * `folders/{folder_id}/locations/{location}` + # * `organizations/{organization_id}/locations/{location}` + # @!attribute [rw] policy_binding_id + # @return [::String] + # Required. The ID to use for the policy binding, which will become the final + # component of the policy binding's resource name. + # + # This value must start with a lowercase letter followed by up to 62 + # lowercase letters, numbers, hyphens, or dots. Pattern, + # /[a-z][a-z0-9-\.]\\{2,62}/. + # @!attribute [rw] policy_binding + # @return [::Google::Iam::V3beta::PolicyBinding] + # Required. The policy binding to create. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the creation, but do not + # actually post it. + class CreatePolicyBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetPolicyBinding method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the policy binding to retrieve. + # + # Format: + # + # * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` + # * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` + # * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` + # * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` + class GetPolicyBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdatePolicyBinding method. + # @!attribute [rw] policy_binding + # @return [::Google::Iam::V3beta::PolicyBinding] + # Required. The policy binding to update. + # + # The policy binding's `name` field is used to identify the policy binding to + # update. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the update, but do not + # actually post it. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The list of fields to update + class UpdatePolicyBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeletePolicyBinding method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the policy binding to delete. + # + # Format: + # + # * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` + # * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` + # * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` + # * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` + # @!attribute [rw] etag + # @return [::String] + # Optional. The etag of the policy binding. + # If this is provided, it must match the server's etag. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the deletion, but do not + # actually post it. + class DeletePolicyBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListPolicyBindings method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource, which owns the collection of policy + # bindings. + # + # Format: + # + # * `projects/{project_id}/locations/{location}` + # * `projects/{project_number}/locations/{location}` + # * `folders/{folder_id}/locations/{location}` + # * `organizations/{organization_id}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of policy bindings to return. The service may + # return fewer than this value. + # + # The default value is 50. The maximum value is 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `ListPolicyBindings` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListPolicyBindings` must + # match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. An expression for filtering the results of the request. Filter + # rules are case insensitive. Some eligible fields for filtering are the + # following: + # + # + `target` + # + `policy` + # + # Some examples of filter queries: + # + # * `target:ex*`: The binding target's name starts with "ex". + # * `target:example`: The binding target's name is `example`. + # * `policy:example`: The binding policy's name is `example`. + class ListPolicyBindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListPolicyBindings method. + # @!attribute [rw] policy_bindings + # @return [::Array<::Google::Iam::V3beta::PolicyBinding>] + # The policy bindings from the specified parent. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. A token, which can be sent as `page_token` to retrieve the next + # page. If this field is omitted, there are no subsequent pages. + class ListPolicyBindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for SearchTargetPolicyBindings method. + # @!attribute [rw] target + # @return [::String] + # Required. The target resource, which is bound to the policy in the binding. + # + # Format: + # + # * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID` + # * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID` + # * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID` + # * `//cloudresourcemanager.googleapis.com/projects/{project_number}` + # * `//cloudresourcemanager.googleapis.com/folders/{folder_id}` + # * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of policy bindings to return. The service may + # return fewer than this value. + # + # The default value is 50. The maximum value is 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous + # `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `SearchTargetPolicyBindingsRequest` must match the call that provided the + # page token. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this search will be performed. This + # should be the nearest Resource Manager resource (project, folder, or + # organization) to the target. + # + # Format: + # + # * `projects/{project_id}/locations/{location}` + # * `projects/{project_number}/locations/{location}` + # * `folders/{folder_id}/locations/{location}` + # * `organizations/{organization_id}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering currently only supports the kind of policies to return, + # and must be in the format "policy_kind=\\{policy_kind}". + # + # If String is empty, bindings bound to all kinds of policies would be + # returned. + # + # The only supported values are the following: + # + # * "policy_kind=PRINCIPAL_ACCESS_BOUNDARY", + # * "policy_kind=ACCESS" + class SearchTargetPolicyBindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for SearchTargetPolicyBindings method. + # @!attribute [rw] policy_bindings + # @return [::Array<::Google::Iam::V3beta::PolicyBinding>] + # The policy bindings bound to the specified target. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. A token, which can be sent as `page_token` to retrieve the next + # page. If this field is omitted, there are no subsequent pages. + class SearchTargetPolicyBindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/principal_access_boundary_policies_service.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/principal_access_boundary_policies_service.rb new file mode 100644 index 000000000000..565de307d98b --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/principal_access_boundary_policies_service.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V3beta + # Request message for CreatePrincipalAccessBoundaryPolicyRequest method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this principal access boundary policy + # will be created. Only organizations are supported. + # + # Format: + # `organizations/{organization_id}/locations/{location}` + # @!attribute [rw] principal_access_boundary_policy_id + # @return [::String] + # Required. The ID to use for the principal access boundary policy, which + # will become the final component of the principal access boundary policy's + # resource name. + # + # This value must start with a lowercase letter followed by up to 62 + # lowercase letters, numbers, hyphens, or dots. Pattern, + # /[a-z][a-z0-9-\.]\\{2,62}/. + # @!attribute [rw] principal_access_boundary_policy + # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy] + # Required. The principal access boundary policy to create. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the creation, but do not + # actually post it. + class CreatePrincipalAccessBoundaryPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetPrincipalAccessBoundaryPolicy method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the principal access boundary policy to retrieve. + # + # Format: + # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` + class GetPrincipalAccessBoundaryPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdatePrincipalAccessBoundaryPolicy method. + # @!attribute [rw] principal_access_boundary_policy + # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy] + # Required. The principal access boundary policy to update. + # + # The principal access boundary policy's `name` field is used to identify the + # policy to update. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the update, but do not + # actually post it. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. The list of fields to update + class UpdatePrincipalAccessBoundaryPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeletePrincipalAccessBoundaryPolicy method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the principal access boundary policy to delete. + # + # Format: + # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` + # @!attribute [rw] etag + # @return [::String] + # Optional. The etag of the principal access boundary policy. + # If this is provided, it must match the server's etag. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the deletion, but do not + # actually post it. + # @!attribute [rw] force + # @return [::Boolean] + # Optional. If set to true, the request will force the deletion of the policy + # even if the policy is referenced in policy bindings. + class DeletePrincipalAccessBoundaryPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListPrincipalAccessBoundaryPolicies method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource, which owns the collection of principal + # access boundary policies. + # + # Format: + # `organizations/{organization_id}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of principal access boundary policies to + # return. The service may return fewer than this value. + # + # If unspecified, at most 50 principal access boundary policies will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous + # `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all other parameters provided to + # `ListPrincipalAccessBoundaryPolicies` must match the call that provided the + # page token. + class ListPrincipalAccessBoundaryPoliciesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListPrincipalAccessBoundaryPolicies method. + # @!attribute [rw] principal_access_boundary_policies + # @return [::Array<::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy>] + # The principal access boundary policies from the specified parent. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. A token, which can be sent as `page_token` to retrieve the next + # page. If this field is omitted, there are no subsequent pages. + class ListPrincipalAccessBoundaryPoliciesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for SearchPrincipalAccessBoundaryPolicyBindings rpc. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the principal access boundary policy. + # Format: + # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of policy bindings to return. The service may + # return fewer than this value. + # + # If unspecified, at most 50 policy bindings will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous + # `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to + # retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call + # that provided the page token. + class SearchPrincipalAccessBoundaryPolicyBindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for SearchPrincipalAccessBoundaryPolicyBindings rpc. + # @!attribute [rw] policy_bindings + # @return [::Array<::Google::Iam::V3beta::PolicyBinding>] + # The policy bindings that reference the specified policy. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. A token, which can be sent as `page_token` to retrieve the next + # page. If this field is omitted, there are no subsequent pages. + class SearchPrincipalAccessBoundaryPolicyBindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/principal_access_boundary_policy_resources.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/principal_access_boundary_policy_resources.rb new file mode 100644 index 000000000000..a01db22285ba --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/principal_access_boundary_policy_resources.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 Iam + module V3beta + # An IAM principal access boundary policy resource. + # @!attribute [rw] name + # @return [::String] + # Identifier. The resource name of the principal access boundary policy. + # + # The following format is supported: + # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}` + # @!attribute [r] uid + # @return [::String] + # Output only. The globally unique ID of the principal access boundary + # policy. + # @!attribute [rw] etag + # @return [::String] + # Optional. The etag for the principal access boundary. + # If this is provided on update, it must match the server's etag. + # @!attribute [rw] display_name + # @return [::String] + # Optional. The description of the principal access boundary policy. Must be + # less than or equal to 63 characters. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. User defined annotations. See + # https://google.aip.dev/148#annotations for more details such as format and + # size limitations + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the principal access boundary policy was + # created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the principal access boundary policy was most + # recently updated. + # @!attribute [rw] details + # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicyDetails] + # Optional. The details for the principal access boundary policy. + class PrincipalAccessBoundaryPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Principal access boundary policy details + # @!attribute [rw] rules + # @return [::Array<::Google::Iam::V3beta::PrincipalAccessBoundaryPolicyRule>] + # Required. A list of principal access boundary policy rules. The number of + # rules in a policy is limited to 500. + # @!attribute [rw] enforcement_version + # @return [::String] + # Optional. + # The version number (for example, `1` or `latest`) that indicates which + # permissions are able to be blocked by the policy. If empty, the PAB policy + # version will be set to the most recent version number at the time of the + # policy's creation. + class PrincipalAccessBoundaryPolicyDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Principal access boundary policy rule that defines the resource boundary. + # @!attribute [rw] description + # @return [::String] + # Optional. The description of the principal access boundary policy rule. + # Must be less than or equal to 256 characters. + # @!attribute [rw] resources + # @return [::Array<::String>] + # Required. A list of Resource Manager resources. If a resource is listed in + # the rule, then the rule applies for that resource and its descendants. The + # number of resources in a policy is limited to 500 across all rules in the + # policy. + # + # The following resource types are supported: + # + # * Organizations, such as + # `//cloudresourcemanager.googleapis.com/organizations/123`. + # * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`. + # * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123` + # or `//cloudresourcemanager.googleapis.com/projects/my-project-id`. + # @!attribute [rw] effect + # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicyRule::Effect] + # Required. The access relationship of principals to the resources in this + # rule. + class PrincipalAccessBoundaryPolicyRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An effect to describe the access relationship. + module Effect + # Effect unspecified. + EFFECT_UNSPECIFIED = 0 + + # Allows access to the resources in this rule. + ALLOW = 1 + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/proto_docs/google/longrunning/operations.rb @@ -0,0 +1,191 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Longrunning + # This resource represents a long-running operation that is the result of a + # network API call. + # @!attribute [rw] name + # @return [::String] + # The server-assigned name, which is only unique within the same service that + # originally returns it. If you use the default HTTP mapping, the + # `name` should be a resource name ending with `operations/{unique_id}`. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Any] + # Service-specific metadata associated with the operation. It typically + # contains progress information and common metadata such as create time. + # Some services might not provide such metadata. Any method that returns a + # long-running operation should document the metadata type, if any. + # @!attribute [rw] done + # @return [::Boolean] + # If the value is `false`, it means the operation is still in progress. + # If `true`, the operation is completed, and either `error` or `response` is + # available. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # The error result of the operation in case of failure or cancellation. + # + # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] response + # @return [::Google::Protobuf::Any] + # The normal, successful response of the operation. If the original + # method returns no data on success, such as `Delete`, the response is + # `google.protobuf.Empty`. If the original method is standard + # `Get`/`Create`/`Update`, the response should be the resource. For other + # methods, the response should have the type `XxxResponse`, where `Xxx` + # is the original method name. For example, if the original method name + # is `TakeSnapshot()`, the inferred response type is + # `TakeSnapshotResponse`. + # + # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Operation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.GetOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource. + class GetOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.ListOperations. + # @!attribute [rw] name + # @return [::String] + # The name of the operation's parent resource. + # @!attribute [rw] filter + # @return [::String] + # The standard list filter. + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # @!attribute [rw] page_token + # @return [::String] + # The standard list page token. + # @!attribute [rw] return_partial_success + # @return [::Boolean] + # When set to `true`, operations that are reachable are returned as normal, + # and those that are unreachable are returned in the + # [ListOperationsResponse.unreachable] field. + # + # This can only be `true` when reading across collections e.g. when `parent` + # is set to `"projects/example/locations/-"`. + # + # This field is not by default supported and will result in an + # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in + # service or product specific documentation. + class ListOperationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for + # Operations.ListOperations. + # @!attribute [rw] operations + # @return [::Array<::Google::Longrunning::Operation>] + # A list of operations that matches the specified filter in the request. + # @!attribute [rw] next_page_token + # @return [::String] + # The standard List next-page token. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unordered list. Unreachable resources. Populated when the request sets + # `ListOperationsRequest.return_partial_success` and reads across + # collections e.g. when attempting to list all resources across all supported + # locations. + class ListOperationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.CancelOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be cancelled. + class CancelOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.DeleteOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to be deleted. + class DeleteOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for + # Operations.WaitOperation. + # @!attribute [rw] name + # @return [::String] + # The name of the operation resource to wait on. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + class WaitOperationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message representing the message types used by a long-running operation. + # + # Example: + # + # rpc Export(ExportRequest) returns (google.longrunning.Operation) { + # option (google.longrunning.operation_info) = { + # response_type: "ExportResponse" + # metadata_type: "ExportMetadata" + # }; + # } + # @!attribute [rw] response_type + # @return [::String] + # Required. The message name of the primary return type for this + # long-running operation. + # This type will be used to deserialize the LRO's response. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + # @!attribute [rw] metadata_type + # @return [::String] + # Required. The message name of the metadata type for this long-running + # operation. + # + # If the response is in a different package from the rpc, a fully-qualified + # message name must be used (e.g. `google.protobuf.Struct`). + # + # Note: Altering this value constitutes a breaking change. + class OperationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/proto_docs/google/type/expr.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/snippets/Gemfile b/owl-bot-staging/google-iam-v3beta/snippets/Gemfile new file mode 100644 index 000000000000..96e4d901d459 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/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-iam-v3beta", path: "../" +else + gem "google-cloud-iam-v3beta" +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-iam-v3beta/snippets/access_policies/create_access_policy.rb b/owl-bot-staging/google-iam-v3beta/snippets/access_policies/create_access_policy.rb new file mode 100644 index 000000000000..97be59c7632e --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/access_policies/create_access_policy.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START iam_v3beta_generated_AccessPolicies_CreateAccessPolicy_sync] +require "google/iam/v3beta" + +## +# Snippet for the create_access_policy call in the AccessPolicies service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::AccessPolicies::Client#create_access_policy. +# +def create_access_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::AccessPolicies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::CreateAccessPolicyRequest.new + + # Call the create_access_policy method. + result = client.create_access_policy request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END iam_v3beta_generated_AccessPolicies_CreateAccessPolicy_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/access_policies/delete_access_policy.rb b/owl-bot-staging/google-iam-v3beta/snippets/access_policies/delete_access_policy.rb new file mode 100644 index 000000000000..39044451fe13 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/access_policies/delete_access_policy.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START iam_v3beta_generated_AccessPolicies_DeleteAccessPolicy_sync] +require "google/iam/v3beta" + +## +# Snippet for the delete_access_policy call in the AccessPolicies service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::AccessPolicies::Client#delete_access_policy. +# +def delete_access_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::AccessPolicies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::DeleteAccessPolicyRequest.new + + # Call the delete_access_policy method. + result = client.delete_access_policy request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END iam_v3beta_generated_AccessPolicies_DeleteAccessPolicy_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/access_policies/get_access_policy.rb b/owl-bot-staging/google-iam-v3beta/snippets/access_policies/get_access_policy.rb new file mode 100644 index 000000000000..dd29cbf9cc54 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/access_policies/get_access_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 iam_v3beta_generated_AccessPolicies_GetAccessPolicy_sync] +require "google/iam/v3beta" + +## +# Snippet for the get_access_policy call in the AccessPolicies service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::AccessPolicies::Client#get_access_policy. +# +def get_access_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::AccessPolicies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::GetAccessPolicyRequest.new + + # Call the get_access_policy method. + result = client.get_access_policy request + + # The returned object is of type Google::Iam::V3beta::AccessPolicy. + p result +end +# [END iam_v3beta_generated_AccessPolicies_GetAccessPolicy_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/access_policies/list_access_policies.rb b/owl-bot-staging/google-iam-v3beta/snippets/access_policies/list_access_policies.rb new file mode 100644 index 000000000000..6ba1518a5a0f --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/access_policies/list_access_policies.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 iam_v3beta_generated_AccessPolicies_ListAccessPolicies_sync] +require "google/iam/v3beta" + +## +# Snippet for the list_access_policies call in the AccessPolicies service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::AccessPolicies::Client#list_access_policies. +# +def list_access_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::AccessPolicies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::ListAccessPoliciesRequest.new + + # Call the list_access_policies method. + result = client.list_access_policies 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::Iam::V3beta::AccessPolicy. + p item + end +end +# [END iam_v3beta_generated_AccessPolicies_ListAccessPolicies_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/access_policies/search_access_policy_bindings.rb b/owl-bot-staging/google-iam-v3beta/snippets/access_policies/search_access_policy_bindings.rb new file mode 100644 index 000000000000..4e6b43897d7b --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/access_policies/search_access_policy_bindings.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 iam_v3beta_generated_AccessPolicies_SearchAccessPolicyBindings_sync] +require "google/iam/v3beta" + +## +# Snippet for the search_access_policy_bindings call in the AccessPolicies service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::AccessPolicies::Client#search_access_policy_bindings. +# +def search_access_policy_bindings + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::AccessPolicies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::SearchAccessPolicyBindingsRequest.new + + # Call the search_access_policy_bindings method. + result = client.search_access_policy_bindings 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::Iam::V3beta::PolicyBinding. + p item + end +end +# [END iam_v3beta_generated_AccessPolicies_SearchAccessPolicyBindings_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/access_policies/update_access_policy.rb b/owl-bot-staging/google-iam-v3beta/snippets/access_policies/update_access_policy.rb new file mode 100644 index 000000000000..72e82547181e --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/access_policies/update_access_policy.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START iam_v3beta_generated_AccessPolicies_UpdateAccessPolicy_sync] +require "google/iam/v3beta" + +## +# Snippet for the update_access_policy call in the AccessPolicies service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::AccessPolicies::Client#update_access_policy. +# +def update_access_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::AccessPolicies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::UpdateAccessPolicyRequest.new + + # Call the update_access_policy method. + result = client.update_access_policy request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END iam_v3beta_generated_AccessPolicies_UpdateAccessPolicy_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/create_policy_binding.rb b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/create_policy_binding.rb new file mode 100644 index 000000000000..71d915589110 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/create_policy_binding.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START iam_v3beta_generated_PolicyBindings_CreatePolicyBinding_sync] +require "google/iam/v3beta" + +## +# Snippet for the create_policy_binding call in the PolicyBindings service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::PolicyBindings::Client#create_policy_binding. +# +def create_policy_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::PolicyBindings::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::CreatePolicyBindingRequest.new + + # Call the create_policy_binding method. + result = client.create_policy_binding request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END iam_v3beta_generated_PolicyBindings_CreatePolicyBinding_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/delete_policy_binding.rb b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/delete_policy_binding.rb new file mode 100644 index 000000000000..71f4b669183c --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/delete_policy_binding.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START iam_v3beta_generated_PolicyBindings_DeletePolicyBinding_sync] +require "google/iam/v3beta" + +## +# Snippet for the delete_policy_binding call in the PolicyBindings service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::PolicyBindings::Client#delete_policy_binding. +# +def delete_policy_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::PolicyBindings::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::DeletePolicyBindingRequest.new + + # Call the delete_policy_binding method. + result = client.delete_policy_binding request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END iam_v3beta_generated_PolicyBindings_DeletePolicyBinding_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/get_policy_binding.rb b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/get_policy_binding.rb new file mode 100644 index 000000000000..95a37b3bd52d --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/get_policy_binding.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 iam_v3beta_generated_PolicyBindings_GetPolicyBinding_sync] +require "google/iam/v3beta" + +## +# Snippet for the get_policy_binding call in the PolicyBindings service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::PolicyBindings::Client#get_policy_binding. +# +def get_policy_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::PolicyBindings::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::GetPolicyBindingRequest.new + + # Call the get_policy_binding method. + result = client.get_policy_binding request + + # The returned object is of type Google::Iam::V3beta::PolicyBinding. + p result +end +# [END iam_v3beta_generated_PolicyBindings_GetPolicyBinding_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/list_policy_bindings.rb b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/list_policy_bindings.rb new file mode 100644 index 000000000000..0f7e29a87412 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/list_policy_bindings.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 iam_v3beta_generated_PolicyBindings_ListPolicyBindings_sync] +require "google/iam/v3beta" + +## +# Snippet for the list_policy_bindings call in the PolicyBindings service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::PolicyBindings::Client#list_policy_bindings. +# +def list_policy_bindings + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::PolicyBindings::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::ListPolicyBindingsRequest.new + + # Call the list_policy_bindings method. + result = client.list_policy_bindings 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::Iam::V3beta::PolicyBinding. + p item + end +end +# [END iam_v3beta_generated_PolicyBindings_ListPolicyBindings_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/search_target_policy_bindings.rb b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/search_target_policy_bindings.rb new file mode 100644 index 000000000000..f27b0677d25b --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/search_target_policy_bindings.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 iam_v3beta_generated_PolicyBindings_SearchTargetPolicyBindings_sync] +require "google/iam/v3beta" + +## +# Snippet for the search_target_policy_bindings call in the PolicyBindings service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::PolicyBindings::Client#search_target_policy_bindings. +# +def search_target_policy_bindings + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::PolicyBindings::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new + + # Call the search_target_policy_bindings method. + result = client.search_target_policy_bindings 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::Iam::V3beta::PolicyBinding. + p item + end +end +# [END iam_v3beta_generated_PolicyBindings_SearchTargetPolicyBindings_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/update_policy_binding.rb b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/update_policy_binding.rb new file mode 100644 index 000000000000..135862214560 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/update_policy_binding.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START iam_v3beta_generated_PolicyBindings_UpdatePolicyBinding_sync] +require "google/iam/v3beta" + +## +# Snippet for the update_policy_binding call in the PolicyBindings service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::PolicyBindings::Client#update_policy_binding. +# +def update_policy_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::PolicyBindings::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::UpdatePolicyBindingRequest.new + + # Call the update_policy_binding method. + result = client.update_policy_binding request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END iam_v3beta_generated_PolicyBindings_UpdatePolicyBinding_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/create_principal_access_boundary_policy.rb b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/create_principal_access_boundary_policy.rb new file mode 100644 index 000000000000..5adbcf4dcc27 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/create_principal_access_boundary_policy.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START iam_v3beta_generated_PrincipalAccessBoundaryPolicies_CreatePrincipalAccessBoundaryPolicy_sync] +require "google/iam/v3beta" + +## +# Snippet for the create_principal_access_boundary_policy call in the PrincipalAccessBoundaryPolicies service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#create_principal_access_boundary_policy. +# +def create_principal_access_boundary_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest.new + + # Call the create_principal_access_boundary_policy method. + result = client.create_principal_access_boundary_policy request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END iam_v3beta_generated_PrincipalAccessBoundaryPolicies_CreatePrincipalAccessBoundaryPolicy_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/delete_principal_access_boundary_policy.rb b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/delete_principal_access_boundary_policy.rb new file mode 100644 index 000000000000..80a3f6830daa --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/delete_principal_access_boundary_policy.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START iam_v3beta_generated_PrincipalAccessBoundaryPolicies_DeletePrincipalAccessBoundaryPolicy_sync] +require "google/iam/v3beta" + +## +# Snippet for the delete_principal_access_boundary_policy call in the PrincipalAccessBoundaryPolicies service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#delete_principal_access_boundary_policy. +# +def delete_principal_access_boundary_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest.new + + # Call the delete_principal_access_boundary_policy method. + result = client.delete_principal_access_boundary_policy request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END iam_v3beta_generated_PrincipalAccessBoundaryPolicies_DeletePrincipalAccessBoundaryPolicy_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/get_principal_access_boundary_policy.rb b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/get_principal_access_boundary_policy.rb new file mode 100644 index 000000000000..a6c6b2d32724 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/get_principal_access_boundary_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 iam_v3beta_generated_PrincipalAccessBoundaryPolicies_GetPrincipalAccessBoundaryPolicy_sync] +require "google/iam/v3beta" + +## +# Snippet for the get_principal_access_boundary_policy call in the PrincipalAccessBoundaryPolicies service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#get_principal_access_boundary_policy. +# +def get_principal_access_boundary_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest.new + + # Call the get_principal_access_boundary_policy method. + result = client.get_principal_access_boundary_policy request + + # The returned object is of type Google::Iam::V3beta::PrincipalAccessBoundaryPolicy. + p result +end +# [END iam_v3beta_generated_PrincipalAccessBoundaryPolicies_GetPrincipalAccessBoundaryPolicy_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/list_principal_access_boundary_policies.rb b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/list_principal_access_boundary_policies.rb new file mode 100644 index 000000000000..6d15a7805873 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/list_principal_access_boundary_policies.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 iam_v3beta_generated_PrincipalAccessBoundaryPolicies_ListPrincipalAccessBoundaryPolicies_sync] +require "google/iam/v3beta" + +## +# Snippet for the list_principal_access_boundary_policies call in the PrincipalAccessBoundaryPolicies service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#list_principal_access_boundary_policies. +# +def list_principal_access_boundary_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest.new + + # Call the list_principal_access_boundary_policies method. + result = client.list_principal_access_boundary_policies 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::Iam::V3beta::PrincipalAccessBoundaryPolicy. + p item + end +end +# [END iam_v3beta_generated_PrincipalAccessBoundaryPolicies_ListPrincipalAccessBoundaryPolicies_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/search_principal_access_boundary_policy_bindings.rb b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/search_principal_access_boundary_policy_bindings.rb new file mode 100644 index 000000000000..f55151327579 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/search_principal_access_boundary_policy_bindings.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 iam_v3beta_generated_PrincipalAccessBoundaryPolicies_SearchPrincipalAccessBoundaryPolicyBindings_sync] +require "google/iam/v3beta" + +## +# Snippet for the search_principal_access_boundary_policy_bindings call in the PrincipalAccessBoundaryPolicies service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#search_principal_access_boundary_policy_bindings. +# +def search_principal_access_boundary_policy_bindings + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest.new + + # Call the search_principal_access_boundary_policy_bindings method. + result = client.search_principal_access_boundary_policy_bindings 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::Iam::V3beta::PolicyBinding. + p item + end +end +# [END iam_v3beta_generated_PrincipalAccessBoundaryPolicies_SearchPrincipalAccessBoundaryPolicyBindings_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/update_principal_access_boundary_policy.rb b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/update_principal_access_boundary_policy.rb new file mode 100644 index 000000000000..821e090ddea2 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/update_principal_access_boundary_policy.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START iam_v3beta_generated_PrincipalAccessBoundaryPolicies_UpdatePrincipalAccessBoundaryPolicy_sync] +require "google/iam/v3beta" + +## +# Snippet for the update_principal_access_boundary_policy call in the PrincipalAccessBoundaryPolicies service +# +# This snippet has been automatically generated and should be regarded as a code +# template only. It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in https://cloud.google.com/ruby/docs/reference. +# +# This is an auto-generated example demonstrating basic usage of +# Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#update_principal_access_boundary_policy. +# +def update_principal_access_boundary_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest.new + + # Call the update_principal_access_boundary_policy method. + result = client.update_principal_access_boundary_policy request + + # The returned object is of type Gapic::Operation. You can use it to + # check the status of an operation, cancel it, or wait for results. + # Here is how to wait for a response. + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "No response received." + end +end +# [END iam_v3beta_generated_PrincipalAccessBoundaryPolicies_UpdatePrincipalAccessBoundaryPolicy_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/snippet_metadata_google.iam.v3beta.json b/owl-bot-staging/google-iam-v3beta/snippets/snippet_metadata_google.iam.v3beta.json new file mode 100644 index 000000000000..88bdb8b21993 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/snippets/snippet_metadata_google.iam.v3beta.json @@ -0,0 +1,735 @@ +{ + "client_library": { + "name": "google-cloud-iam-v3beta", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.iam.v3beta", + "version": "v3beta" + } + ] + }, + "snippets": [ + { + "region_tag": "iam_v3beta_generated_AccessPolicies_CreateAccessPolicy_sync", + "title": "Snippet for the create_access_policy call in the AccessPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#create_access_policy.", + "file": "access_policies/create_access_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_access_policy", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#create_access_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::CreateAccessPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AccessPolicies::Client", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" + }, + "method": { + "short_name": "CreateAccessPolicy", + "full_name": "google.iam.v3beta.AccessPolicies.CreateAccessPolicy", + "service": { + "short_name": "AccessPolicies", + "full_name": "google.iam.v3beta.AccessPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_AccessPolicies_GetAccessPolicy_sync", + "title": "Snippet for the get_access_policy call in the AccessPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#get_access_policy.", + "file": "access_policies/get_access_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_access_policy", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#get_access_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::GetAccessPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V3beta::AccessPolicy", + "client": { + "short_name": "AccessPolicies::Client", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" + }, + "method": { + "short_name": "GetAccessPolicy", + "full_name": "google.iam.v3beta.AccessPolicies.GetAccessPolicy", + "service": { + "short_name": "AccessPolicies", + "full_name": "google.iam.v3beta.AccessPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_AccessPolicies_UpdateAccessPolicy_sync", + "title": "Snippet for the update_access_policy call in the AccessPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#update_access_policy.", + "file": "access_policies/update_access_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_access_policy", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#update_access_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::UpdateAccessPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AccessPolicies::Client", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" + }, + "method": { + "short_name": "UpdateAccessPolicy", + "full_name": "google.iam.v3beta.AccessPolicies.UpdateAccessPolicy", + "service": { + "short_name": "AccessPolicies", + "full_name": "google.iam.v3beta.AccessPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_AccessPolicies_DeleteAccessPolicy_sync", + "title": "Snippet for the delete_access_policy call in the AccessPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#delete_access_policy.", + "file": "access_policies/delete_access_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_access_policy", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#delete_access_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::DeleteAccessPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AccessPolicies::Client", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" + }, + "method": { + "short_name": "DeleteAccessPolicy", + "full_name": "google.iam.v3beta.AccessPolicies.DeleteAccessPolicy", + "service": { + "short_name": "AccessPolicies", + "full_name": "google.iam.v3beta.AccessPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_AccessPolicies_ListAccessPolicies_sync", + "title": "Snippet for the list_access_policies call in the AccessPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#list_access_policies.", + "file": "access_policies/list_access_policies.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_access_policies", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#list_access_policies", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::ListAccessPoliciesRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V3beta::ListAccessPoliciesResponse", + "client": { + "short_name": "AccessPolicies::Client", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" + }, + "method": { + "short_name": "ListAccessPolicies", + "full_name": "google.iam.v3beta.AccessPolicies.ListAccessPolicies", + "service": { + "short_name": "AccessPolicies", + "full_name": "google.iam.v3beta.AccessPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_AccessPolicies_SearchAccessPolicyBindings_sync", + "title": "Snippet for the search_access_policy_bindings call in the AccessPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#search_access_policy_bindings.", + "file": "access_policies/search_access_policy_bindings.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_access_policy_bindings", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#search_access_policy_bindings", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V3beta::SearchAccessPolicyBindingsResponse", + "client": { + "short_name": "AccessPolicies::Client", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" + }, + "method": { + "short_name": "SearchAccessPolicyBindings", + "full_name": "google.iam.v3beta.AccessPolicies.SearchAccessPolicyBindings", + "service": { + "short_name": "AccessPolicies", + "full_name": "google.iam.v3beta.AccessPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_PolicyBindings_CreatePolicyBinding_sync", + "title": "Snippet for the create_policy_binding call in the PolicyBindings service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PolicyBindings::Client#create_policy_binding.", + "file": "policy_bindings/create_policy_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_policy_binding", + "full_name": "::Google::Iam::V3beta::PolicyBindings::Client#create_policy_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::CreatePolicyBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "PolicyBindings::Client", + "full_name": "::Google::Iam::V3beta::PolicyBindings::Client" + }, + "method": { + "short_name": "CreatePolicyBinding", + "full_name": "google.iam.v3beta.PolicyBindings.CreatePolicyBinding", + "service": { + "short_name": "PolicyBindings", + "full_name": "google.iam.v3beta.PolicyBindings" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_PolicyBindings_GetPolicyBinding_sync", + "title": "Snippet for the get_policy_binding call in the PolicyBindings service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PolicyBindings::Client#get_policy_binding.", + "file": "policy_bindings/get_policy_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_policy_binding", + "full_name": "::Google::Iam::V3beta::PolicyBindings::Client#get_policy_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::GetPolicyBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V3beta::PolicyBinding", + "client": { + "short_name": "PolicyBindings::Client", + "full_name": "::Google::Iam::V3beta::PolicyBindings::Client" + }, + "method": { + "short_name": "GetPolicyBinding", + "full_name": "google.iam.v3beta.PolicyBindings.GetPolicyBinding", + "service": { + "short_name": "PolicyBindings", + "full_name": "google.iam.v3beta.PolicyBindings" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_PolicyBindings_UpdatePolicyBinding_sync", + "title": "Snippet for the update_policy_binding call in the PolicyBindings service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PolicyBindings::Client#update_policy_binding.", + "file": "policy_bindings/update_policy_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_policy_binding", + "full_name": "::Google::Iam::V3beta::PolicyBindings::Client#update_policy_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::UpdatePolicyBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "PolicyBindings::Client", + "full_name": "::Google::Iam::V3beta::PolicyBindings::Client" + }, + "method": { + "short_name": "UpdatePolicyBinding", + "full_name": "google.iam.v3beta.PolicyBindings.UpdatePolicyBinding", + "service": { + "short_name": "PolicyBindings", + "full_name": "google.iam.v3beta.PolicyBindings" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_PolicyBindings_DeletePolicyBinding_sync", + "title": "Snippet for the delete_policy_binding call in the PolicyBindings service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PolicyBindings::Client#delete_policy_binding.", + "file": "policy_bindings/delete_policy_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_policy_binding", + "full_name": "::Google::Iam::V3beta::PolicyBindings::Client#delete_policy_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::DeletePolicyBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "PolicyBindings::Client", + "full_name": "::Google::Iam::V3beta::PolicyBindings::Client" + }, + "method": { + "short_name": "DeletePolicyBinding", + "full_name": "google.iam.v3beta.PolicyBindings.DeletePolicyBinding", + "service": { + "short_name": "PolicyBindings", + "full_name": "google.iam.v3beta.PolicyBindings" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_PolicyBindings_ListPolicyBindings_sync", + "title": "Snippet for the list_policy_bindings call in the PolicyBindings service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PolicyBindings::Client#list_policy_bindings.", + "file": "policy_bindings/list_policy_bindings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_policy_bindings", + "full_name": "::Google::Iam::V3beta::PolicyBindings::Client#list_policy_bindings", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::ListPolicyBindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V3beta::ListPolicyBindingsResponse", + "client": { + "short_name": "PolicyBindings::Client", + "full_name": "::Google::Iam::V3beta::PolicyBindings::Client" + }, + "method": { + "short_name": "ListPolicyBindings", + "full_name": "google.iam.v3beta.PolicyBindings.ListPolicyBindings", + "service": { + "short_name": "PolicyBindings", + "full_name": "google.iam.v3beta.PolicyBindings" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_PolicyBindings_SearchTargetPolicyBindings_sync", + "title": "Snippet for the search_target_policy_bindings call in the PolicyBindings service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PolicyBindings::Client#search_target_policy_bindings.", + "file": "policy_bindings/search_target_policy_bindings.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_target_policy_bindings", + "full_name": "::Google::Iam::V3beta::PolicyBindings::Client#search_target_policy_bindings", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V3beta::SearchTargetPolicyBindingsResponse", + "client": { + "short_name": "PolicyBindings::Client", + "full_name": "::Google::Iam::V3beta::PolicyBindings::Client" + }, + "method": { + "short_name": "SearchTargetPolicyBindings", + "full_name": "google.iam.v3beta.PolicyBindings.SearchTargetPolicyBindings", + "service": { + "short_name": "PolicyBindings", + "full_name": "google.iam.v3beta.PolicyBindings" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_PrincipalAccessBoundaryPolicies_CreatePrincipalAccessBoundaryPolicy_sync", + "title": "Snippet for the create_principal_access_boundary_policy call in the PrincipalAccessBoundaryPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#create_principal_access_boundary_policy.", + "file": "principal_access_boundary_policies/create_principal_access_boundary_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_principal_access_boundary_policy", + "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#create_principal_access_boundary_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "PrincipalAccessBoundaryPolicies::Client", + "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client" + }, + "method": { + "short_name": "CreatePrincipalAccessBoundaryPolicy", + "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies.CreatePrincipalAccessBoundaryPolicy", + "service": { + "short_name": "PrincipalAccessBoundaryPolicies", + "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_PrincipalAccessBoundaryPolicies_GetPrincipalAccessBoundaryPolicy_sync", + "title": "Snippet for the get_principal_access_boundary_policy call in the PrincipalAccessBoundaryPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#get_principal_access_boundary_policy.", + "file": "principal_access_boundary_policies/get_principal_access_boundary_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_principal_access_boundary_policy", + "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#get_principal_access_boundary_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy", + "client": { + "short_name": "PrincipalAccessBoundaryPolicies::Client", + "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client" + }, + "method": { + "short_name": "GetPrincipalAccessBoundaryPolicy", + "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies.GetPrincipalAccessBoundaryPolicy", + "service": { + "short_name": "PrincipalAccessBoundaryPolicies", + "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_PrincipalAccessBoundaryPolicies_UpdatePrincipalAccessBoundaryPolicy_sync", + "title": "Snippet for the update_principal_access_boundary_policy call in the PrincipalAccessBoundaryPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#update_principal_access_boundary_policy.", + "file": "principal_access_boundary_policies/update_principal_access_boundary_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_principal_access_boundary_policy", + "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#update_principal_access_boundary_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "PrincipalAccessBoundaryPolicies::Client", + "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client" + }, + "method": { + "short_name": "UpdatePrincipalAccessBoundaryPolicy", + "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies.UpdatePrincipalAccessBoundaryPolicy", + "service": { + "short_name": "PrincipalAccessBoundaryPolicies", + "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_PrincipalAccessBoundaryPolicies_DeletePrincipalAccessBoundaryPolicy_sync", + "title": "Snippet for the delete_principal_access_boundary_policy call in the PrincipalAccessBoundaryPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#delete_principal_access_boundary_policy.", + "file": "principal_access_boundary_policies/delete_principal_access_boundary_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_principal_access_boundary_policy", + "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#delete_principal_access_boundary_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "PrincipalAccessBoundaryPolicies::Client", + "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client" + }, + "method": { + "short_name": "DeletePrincipalAccessBoundaryPolicy", + "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies.DeletePrincipalAccessBoundaryPolicy", + "service": { + "short_name": "PrincipalAccessBoundaryPolicies", + "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_PrincipalAccessBoundaryPolicies_ListPrincipalAccessBoundaryPolicies_sync", + "title": "Snippet for the list_principal_access_boundary_policies call in the PrincipalAccessBoundaryPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#list_principal_access_boundary_policies.", + "file": "principal_access_boundary_policies/list_principal_access_boundary_policies.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_principal_access_boundary_policies", + "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#list_principal_access_boundary_policies", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesResponse", + "client": { + "short_name": "PrincipalAccessBoundaryPolicies::Client", + "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client" + }, + "method": { + "short_name": "ListPrincipalAccessBoundaryPolicies", + "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies.ListPrincipalAccessBoundaryPolicies", + "service": { + "short_name": "PrincipalAccessBoundaryPolicies", + "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_PrincipalAccessBoundaryPolicies_SearchPrincipalAccessBoundaryPolicyBindings_sync", + "title": "Snippet for the search_principal_access_boundary_policy_bindings call in the PrincipalAccessBoundaryPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#search_principal_access_boundary_policy_bindings.", + "file": "principal_access_boundary_policies/search_principal_access_boundary_policy_bindings.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_principal_access_boundary_policy_bindings", + "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#search_principal_access_boundary_policy_bindings", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsResponse", + "client": { + "short_name": "PrincipalAccessBoundaryPolicies::Client", + "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client" + }, + "method": { + "short_name": "SearchPrincipalAccessBoundaryPolicyBindings", + "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies.SearchPrincipalAccessBoundaryPolicyBindings", + "service": { + "short_name": "PrincipalAccessBoundaryPolicies", + "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_operations_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_operations_test.rb new file mode 100644 index 000000000000..2b61d2eea2a1 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/iam/v3beta/access_policies_service_pb" +require "google/iam/v3beta/access_policies_service_services_pb" +require "google/iam/v3beta/access_policies" + +class ::Google::Iam::V3beta::AccessPolicies::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Iam::V3beta::AccessPolicies::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Iam::V3beta::AccessPolicies::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_paths_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_paths_test.rb new file mode 100644 index 000000000000..2e29e3248257 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_paths_test.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/iam/v3beta/access_policies" + +class ::Google::Iam::V3beta::AccessPolicies::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_access_policy_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.access_policy_path organization: "value0", location: "value1", access_policy: "value2" + assert_equal "organizations/value0/locations/value1/accessPolicies/value2", path + + path = client.access_policy_path folder: "value0", location: "value1", access_policy: "value2" + assert_equal "folders/value0/locations/value1/accessPolicies/value2", path + + path = client.access_policy_path project: "value0", location: "value1", access_policy: "value2" + assert_equal "projects/value0/locations/value1/accessPolicies/value2", path + end + end + + def test_folder_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.folder_location_path folder: "value0", location: "value1" + assert_equal "folders/value0/locations/value1", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Iam::V3beta::AccessPolicies::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_organization_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.organization_location_path organization: "value0", location: "value1" + assert_equal "organizations/value0/locations/value1", path + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_rest_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_rest_test.rb new file mode 100644 index 000000000000..8d0ded48f620 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_rest_test.rb @@ -0,0 +1,434 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/iam/v3beta/access_policies_service_pb" +require "google/iam/v3beta/access_policies/rest" + + +class ::Google::Iam::V3beta::AccessPolicies::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_create_access_policy + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + access_policy_id = "hello world" + access_policy = {} + validate_only = true + + create_access_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::AccessPolicies::Rest::ServiceStub.stub :transcode_create_access_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_access_policy_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_access_policy({ parent: parent, access_policy_id: access_policy_id, access_policy: access_policy, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_access_policy parent: parent, access_policy_id: access_policy_id, access_policy: access_policy, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_access_policy ::Google::Iam::V3beta::CreateAccessPolicyRequest.new(parent: parent, access_policy_id: access_policy_id, access_policy: access_policy, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_access_policy({ parent: parent, access_policy_id: access_policy_id, access_policy: access_policy, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_access_policy(::Google::Iam::V3beta::CreateAccessPolicyRequest.new(parent: parent, access_policy_id: access_policy_id, access_policy: access_policy, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_access_policy_client_stub.call_count + end + end + end + + def test_get_access_policy + # Create test objects. + client_result = ::Google::Iam::V3beta::AccessPolicy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_access_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::AccessPolicies::Rest::ServiceStub.stub :transcode_get_access_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_access_policy_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_access_policy({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_access_policy name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_access_policy ::Google::Iam::V3beta::GetAccessPolicyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_access_policy({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_access_policy(::Google::Iam::V3beta::GetAccessPolicyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_access_policy_client_stub.call_count + end + end + end + + def test_update_access_policy + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + access_policy = {} + validate_only = true + + update_access_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::AccessPolicies::Rest::ServiceStub.stub :transcode_update_access_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_access_policy_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_access_policy({ access_policy: access_policy, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_access_policy access_policy: access_policy, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_access_policy ::Google::Iam::V3beta::UpdateAccessPolicyRequest.new(access_policy: access_policy, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_access_policy({ access_policy: access_policy, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_access_policy(::Google::Iam::V3beta::UpdateAccessPolicyRequest.new(access_policy: access_policy, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_access_policy_client_stub.call_count + end + end + end + + def test_delete_access_policy + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + force = true + + delete_access_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::AccessPolicies::Rest::ServiceStub.stub :transcode_delete_access_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_access_policy_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_access_policy({ name: name, etag: etag, validate_only: validate_only, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_access_policy name: name, etag: etag, validate_only: validate_only, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_access_policy ::Google::Iam::V3beta::DeleteAccessPolicyRequest.new(name: name, etag: etag, validate_only: validate_only, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_access_policy({ name: name, etag: etag, validate_only: validate_only, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_access_policy(::Google::Iam::V3beta::DeleteAccessPolicyRequest.new(name: name, etag: etag, validate_only: validate_only, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_access_policy_client_stub.call_count + end + end + end + + def test_list_access_policies + # Create test objects. + client_result = ::Google::Iam::V3beta::ListAccessPoliciesResponse.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" + + list_access_policies_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::AccessPolicies::Rest::ServiceStub.stub :transcode_list_access_policies_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_access_policies_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_access_policies({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_access_policies parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_access_policies ::Google::Iam::V3beta::ListAccessPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_access_policies({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_access_policies(::Google::Iam::V3beta::ListAccessPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_access_policies_client_stub.call_count + end + end + end + + def test_search_access_policy_bindings + # Create test objects. + client_result = ::Google::Iam::V3beta::SearchAccessPolicyBindingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + page_size = 42 + page_token = "hello world" + + search_access_policy_bindings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::AccessPolicies::Rest::ServiceStub.stub :transcode_search_access_policy_bindings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_access_policy_bindings_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_access_policy_bindings({ name: name, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_access_policy_bindings name: name, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_access_policy_bindings ::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest.new(name: name, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_access_policy_bindings({ name: name, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_access_policy_bindings(::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest.new(name: name, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_access_policy_bindings_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Iam::V3beta::AccessPolicies::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_test.rb new file mode 100644 index 000000000000..78d84bfdeff7 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_test.rb @@ -0,0 +1,513 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/iam/v3beta/access_policies_service_pb" +require "google/iam/v3beta/access_policies" + +class ::Google::Iam::V3beta::AccessPolicies::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_access_policy + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + access_policy_id = "hello world" + access_policy = {} + validate_only = true + + create_access_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_access_policy, name + assert_kind_of ::Google::Iam::V3beta::CreateAccessPolicyRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["access_policy_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V3beta::AccessPolicy), request["access_policy"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_access_policy_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_access_policy({ parent: parent, access_policy_id: access_policy_id, access_policy: access_policy, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_access_policy parent: parent, access_policy_id: access_policy_id, access_policy: access_policy, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_access_policy ::Google::Iam::V3beta::CreateAccessPolicyRequest.new(parent: parent, access_policy_id: access_policy_id, access_policy: access_policy, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_access_policy({ parent: parent, access_policy_id: access_policy_id, access_policy: access_policy, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_access_policy(::Google::Iam::V3beta::CreateAccessPolicyRequest.new(parent: parent, access_policy_id: access_policy_id, access_policy: access_policy, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_access_policy_client_stub.call_rpc_count + end + end + + def test_get_access_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V3beta::AccessPolicy.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_access_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_access_policy, name + assert_kind_of ::Google::Iam::V3beta::GetAccessPolicyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_access_policy_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_access_policy({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_access_policy name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_access_policy ::Google::Iam::V3beta::GetAccessPolicyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_access_policy({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_access_policy(::Google::Iam::V3beta::GetAccessPolicyRequest.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_access_policy_client_stub.call_rpc_count + end + end + + def test_update_access_policy + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + access_policy = {} + validate_only = true + + update_access_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_access_policy, name + assert_kind_of ::Google::Iam::V3beta::UpdateAccessPolicyRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V3beta::AccessPolicy), request["access_policy"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_access_policy_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_access_policy({ access_policy: access_policy, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_access_policy access_policy: access_policy, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_access_policy ::Google::Iam::V3beta::UpdateAccessPolicyRequest.new(access_policy: access_policy, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_access_policy({ access_policy: access_policy, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_access_policy(::Google::Iam::V3beta::UpdateAccessPolicyRequest.new(access_policy: access_policy, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_access_policy_client_stub.call_rpc_count + end + end + + def test_delete_access_policy + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + force = true + + delete_access_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_access_policy, name + assert_kind_of ::Google::Iam::V3beta::DeleteAccessPolicyRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_access_policy_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_access_policy({ name: name, etag: etag, validate_only: validate_only, force: force }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_access_policy name: name, etag: etag, validate_only: validate_only, force: force do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_access_policy ::Google::Iam::V3beta::DeleteAccessPolicyRequest.new(name: name, etag: etag, validate_only: validate_only, force: force) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_access_policy({ name: name, etag: etag, validate_only: validate_only, force: force }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_access_policy(::Google::Iam::V3beta::DeleteAccessPolicyRequest.new(name: name, etag: etag, validate_only: validate_only, force: force), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_access_policy_client_stub.call_rpc_count + end + end + + def test_list_access_policies + # Create GRPC objects. + grpc_response = ::Google::Iam::V3beta::ListAccessPoliciesResponse.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" + + list_access_policies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_access_policies, name + assert_kind_of ::Google::Iam::V3beta::ListAccessPoliciesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_access_policies_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_access_policies({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_access_policies parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_access_policies ::Google::Iam::V3beta::ListAccessPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_access_policies({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_access_policies(::Google::Iam::V3beta::ListAccessPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_access_policies_client_stub.call_rpc_count + end + end + + def test_search_access_policy_bindings + # Create GRPC objects. + grpc_response = ::Google::Iam::V3beta::SearchAccessPolicyBindingsResponse.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" + page_size = 42 + page_token = "hello world" + + search_access_policy_bindings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_access_policy_bindings, name + assert_kind_of ::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_access_policy_bindings_client_stub do + # Create client + client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_access_policy_bindings({ name: name, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_access_policy_bindings name: name, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_access_policy_bindings ::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest.new(name: name, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_access_policy_bindings({ name: name, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_access_policy_bindings(::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest.new(name: name, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_access_policy_bindings_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Iam::V3beta::AccessPolicies::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Iam::V3beta::AccessPolicies::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Iam::V3beta::AccessPolicies::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_operations_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_operations_test.rb new file mode 100644 index 000000000000..511734647747 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/iam/v3beta/policy_bindings_service_pb" +require "google/iam/v3beta/policy_bindings_service_services_pb" +require "google/iam/v3beta/policy_bindings" + +class ::Google::Iam::V3beta::PolicyBindings::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Iam::V3beta::PolicyBindings::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Iam::V3beta::PolicyBindings::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_paths_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_paths_test.rb new file mode 100644 index 000000000000..25795739b50c --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_paths_test.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/iam/v3beta/policy_bindings" + +class ::Google::Iam::V3beta::PolicyBindings::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_folder_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.folder_location_path folder: "value0", location: "value1" + assert_equal "folders/value0/locations/value1", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Iam::V3beta::PolicyBindings::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_organization_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.organization_location_path organization: "value0", location: "value1" + assert_equal "organizations/value0/locations/value1", path + end + end + + def test_policy_binding_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.policy_binding_path organization: "value0", location: "value1", policy_binding: "value2" + assert_equal "organizations/value0/locations/value1/policyBindings/value2", path + + path = client.policy_binding_path folder: "value0", location: "value1", policy_binding: "value2" + assert_equal "folders/value0/locations/value1/policyBindings/value2", path + + path = client.policy_binding_path project: "value0", location: "value1", policy_binding: "value2" + assert_equal "projects/value0/locations/value1/policyBindings/value2", path + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_rest_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_rest_test.rb new file mode 100644 index 000000000000..4e42bfa38dda --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_rest_test.rb @@ -0,0 +1,437 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/iam/v3beta/policy_bindings_service_pb" +require "google/iam/v3beta/policy_bindings/rest" + + +class ::Google::Iam::V3beta::PolicyBindings::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_create_policy_binding + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + policy_binding_id = "hello world" + policy_binding = {} + validate_only = true + + create_policy_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::PolicyBindings::Rest::ServiceStub.stub :transcode_create_policy_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_policy_binding_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_policy_binding({ parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_policy_binding parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_policy_binding ::Google::Iam::V3beta::CreatePolicyBindingRequest.new(parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_policy_binding({ parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_policy_binding(::Google::Iam::V3beta::CreatePolicyBindingRequest.new(parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_policy_binding_client_stub.call_count + end + end + end + + def test_get_policy_binding + # Create test objects. + client_result = ::Google::Iam::V3beta::PolicyBinding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_policy_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::PolicyBindings::Rest::ServiceStub.stub :transcode_get_policy_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_policy_binding_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_policy_binding({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_policy_binding name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_policy_binding ::Google::Iam::V3beta::GetPolicyBindingRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_policy_binding({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_policy_binding(::Google::Iam::V3beta::GetPolicyBindingRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_policy_binding_client_stub.call_count + end + end + end + + def test_update_policy_binding + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + policy_binding = {} + validate_only = true + update_mask = {} + + update_policy_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::PolicyBindings::Rest::ServiceStub.stub :transcode_update_policy_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_policy_binding_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_policy_binding({ policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_policy_binding policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_policy_binding ::Google::Iam::V3beta::UpdatePolicyBindingRequest.new(policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_policy_binding({ policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_policy_binding(::Google::Iam::V3beta::UpdatePolicyBindingRequest.new(policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_policy_binding_client_stub.call_count + end + end + end + + def test_delete_policy_binding + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + + delete_policy_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::PolicyBindings::Rest::ServiceStub.stub :transcode_delete_policy_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_policy_binding_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_policy_binding({ name: name, etag: etag, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_policy_binding name: name, etag: etag, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_policy_binding ::Google::Iam::V3beta::DeletePolicyBindingRequest.new(name: name, etag: etag, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_policy_binding({ name: name, etag: etag, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_policy_binding(::Google::Iam::V3beta::DeletePolicyBindingRequest.new(name: name, etag: etag, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_policy_binding_client_stub.call_count + end + end + end + + def test_list_policy_bindings + # Create test objects. + client_result = ::Google::Iam::V3beta::ListPolicyBindingsResponse.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_policy_bindings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::PolicyBindings::Rest::ServiceStub.stub :transcode_list_policy_bindings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_policy_bindings_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_policy_bindings({ 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 + client.list_policy_bindings 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 + client.list_policy_bindings ::Google::Iam::V3beta::ListPolicyBindingsRequest.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 + client.list_policy_bindings({ 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 + client.list_policy_bindings(::Google::Iam::V3beta::ListPolicyBindingsRequest.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_policy_bindings_client_stub.call_count + end + end + end + + def test_search_target_policy_bindings + # Create test objects. + client_result = ::Google::Iam::V3beta::SearchTargetPolicyBindingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + target = "hello world" + page_size = 42 + page_token = "hello world" + parent = "hello world" + filter = "hello world" + + search_target_policy_bindings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::PolicyBindings::Rest::ServiceStub.stub :transcode_search_target_policy_bindings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_target_policy_bindings_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_target_policy_bindings({ target: target, page_size: page_size, page_token: page_token, parent: parent, filter: filter }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_target_policy_bindings target: target, page_size: page_size, page_token: page_token, parent: parent, filter: filter do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_target_policy_bindings ::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new(target: target, page_size: page_size, page_token: page_token, parent: parent, filter: filter) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_target_policy_bindings({ target: target, page_size: page_size, page_token: page_token, parent: parent, filter: filter }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_target_policy_bindings(::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new(target: target, page_size: page_size, page_token: page_token, parent: parent, filter: filter), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_target_policy_bindings_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Iam::V3beta::PolicyBindings::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_test.rb new file mode 100644 index 000000000000..be97e0981402 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_test.rb @@ -0,0 +1,519 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/iam/v3beta/policy_bindings_service_pb" +require "google/iam/v3beta/policy_bindings" + +class ::Google::Iam::V3beta::PolicyBindings::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_policy_binding + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + policy_binding_id = "hello world" + policy_binding = {} + validate_only = true + + create_policy_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_policy_binding, name + assert_kind_of ::Google::Iam::V3beta::CreatePolicyBindingRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["policy_binding_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V3beta::PolicyBinding), request["policy_binding"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_policy_binding_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_policy_binding({ parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_policy_binding parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_policy_binding ::Google::Iam::V3beta::CreatePolicyBindingRequest.new(parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_policy_binding({ parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_policy_binding(::Google::Iam::V3beta::CreatePolicyBindingRequest.new(parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_policy_binding_client_stub.call_rpc_count + end + end + + def test_get_policy_binding + # Create GRPC objects. + grpc_response = ::Google::Iam::V3beta::PolicyBinding.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_policy_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_policy_binding, name + assert_kind_of ::Google::Iam::V3beta::GetPolicyBindingRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_policy_binding_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_policy_binding({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_policy_binding name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_policy_binding ::Google::Iam::V3beta::GetPolicyBindingRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_policy_binding({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_policy_binding(::Google::Iam::V3beta::GetPolicyBindingRequest.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_policy_binding_client_stub.call_rpc_count + end + end + + def test_update_policy_binding + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + policy_binding = {} + validate_only = true + update_mask = {} + + update_policy_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_policy_binding, name + assert_kind_of ::Google::Iam::V3beta::UpdatePolicyBindingRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V3beta::PolicyBinding), request["policy_binding"] + assert_equal true, request["validate_only"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_policy_binding_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_policy_binding({ policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_policy_binding policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_policy_binding ::Google::Iam::V3beta::UpdatePolicyBindingRequest.new(policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_policy_binding({ policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_policy_binding(::Google::Iam::V3beta::UpdatePolicyBindingRequest.new(policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_policy_binding_client_stub.call_rpc_count + end + end + + def test_delete_policy_binding + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + + delete_policy_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_policy_binding, name + assert_kind_of ::Google::Iam::V3beta::DeletePolicyBindingRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_policy_binding_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_policy_binding({ name: name, etag: etag, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_policy_binding name: name, etag: etag, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_policy_binding ::Google::Iam::V3beta::DeletePolicyBindingRequest.new(name: name, etag: etag, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_policy_binding({ name: name, etag: etag, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_policy_binding(::Google::Iam::V3beta::DeletePolicyBindingRequest.new(name: name, etag: etag, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_policy_binding_client_stub.call_rpc_count + end + end + + def test_list_policy_bindings + # Create GRPC objects. + grpc_response = ::Google::Iam::V3beta::ListPolicyBindingsResponse.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_policy_bindings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_policy_bindings, name + assert_kind_of ::Google::Iam::V3beta::ListPolicyBindingsRequest, 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_policy_bindings_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_policy_bindings({ 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 + client.list_policy_bindings 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 + client.list_policy_bindings ::Google::Iam::V3beta::ListPolicyBindingsRequest.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 + client.list_policy_bindings({ 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 + client.list_policy_bindings(::Google::Iam::V3beta::ListPolicyBindingsRequest.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_policy_bindings_client_stub.call_rpc_count + end + end + + def test_search_target_policy_bindings + # Create GRPC objects. + grpc_response = ::Google::Iam::V3beta::SearchTargetPolicyBindingsResponse.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. + target = "hello world" + page_size = 42 + page_token = "hello world" + parent = "hello world" + filter = "hello world" + + search_target_policy_bindings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_target_policy_bindings, name + assert_kind_of ::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest, request + assert_equal "hello world", request["target"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_target_policy_bindings_client_stub do + # Create client + client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_target_policy_bindings({ target: target, page_size: page_size, page_token: page_token, parent: parent, 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 + client.search_target_policy_bindings target: target, page_size: page_size, page_token: page_token, parent: parent, 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 + client.search_target_policy_bindings ::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new(target: target, page_size: page_size, page_token: page_token, parent: parent, 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 + client.search_target_policy_bindings({ target: target, page_size: page_size, page_token: page_token, parent: parent, 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 + client.search_target_policy_bindings(::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new(target: target, page_size: page_size, page_token: page_token, parent: parent, 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, search_target_policy_bindings_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Iam::V3beta::PolicyBindings::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Iam::V3beta::PolicyBindings::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Iam::V3beta::PolicyBindings::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_operations_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_operations_test.rb new file mode 100644 index 000000000000..ed86bcce8c03 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_operations_test.rb @@ -0,0 +1,400 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/iam/v3beta/principal_access_boundary_policies_service_pb" +require "google/iam/v3beta/principal_access_boundary_policies_service_services_pb" +require "google/iam/v3beta/principal_access_boundary_policies" + +class ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + return_partial_success = true + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["return_partial_success"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_paths_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_paths_test.rb new file mode 100644 index 000000000000..e7a89396ed57 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_paths_test.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/iam/v3beta/principal_access_boundary_policies" + +class ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::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_organization_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.organization_location_path organization: "value0", location: "value1" + assert_equal "organizations/value0/locations/value1", path + end + end + + def test_principal_access_boundary_policy_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.principal_access_boundary_policy_path organization: "value0", location: "value1", principal_access_boundary_policy: "value2" + assert_equal "organizations/value0/locations/value1/principalAccessBoundaryPolicies/value2", path + end + end +end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_rest_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_rest_test.rb new file mode 100644 index 000000000000..c05429d23690 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_rest_test.rb @@ -0,0 +1,435 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "gapic/rest" +require "google/iam/v3beta/principal_access_boundary_policies_service_pb" +require "google/iam/v3beta/principal_access_boundary_policies/rest" + + +class ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::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_create_principal_access_boundary_policy + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + principal_access_boundary_policy_id = "hello world" + principal_access_boundary_policy = {} + validate_only = true + + create_principal_access_boundary_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::ServiceStub.stub :transcode_create_principal_access_boundary_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_principal_access_boundary_policy_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_principal_access_boundary_policy({ parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_principal_access_boundary_policy parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_principal_access_boundary_policy ::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest.new(parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_principal_access_boundary_policy({ parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_principal_access_boundary_policy(::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest.new(parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_principal_access_boundary_policy_client_stub.call_count + end + end + end + + def test_get_principal_access_boundary_policy + # Create test objects. + client_result = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_principal_access_boundary_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::ServiceStub.stub :transcode_get_principal_access_boundary_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_principal_access_boundary_policy_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_principal_access_boundary_policy({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_principal_access_boundary_policy name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_principal_access_boundary_policy ::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_principal_access_boundary_policy({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_principal_access_boundary_policy(::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_principal_access_boundary_policy_client_stub.call_count + end + end + end + + def test_update_principal_access_boundary_policy + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + principal_access_boundary_policy = {} + validate_only = true + update_mask = {} + + update_principal_access_boundary_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::ServiceStub.stub :transcode_update_principal_access_boundary_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_principal_access_boundary_policy_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_principal_access_boundary_policy({ principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_principal_access_boundary_policy principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_principal_access_boundary_policy ::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest.new(principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_principal_access_boundary_policy({ principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_principal_access_boundary_policy(::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest.new(principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_principal_access_boundary_policy_client_stub.call_count + end + end + end + + def test_delete_principal_access_boundary_policy + # Create test objects. + client_result = ::Google::Longrunning::Operation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + force = true + + delete_principal_access_boundary_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::ServiceStub.stub :transcode_delete_principal_access_boundary_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_principal_access_boundary_policy_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_principal_access_boundary_policy({ name: name, etag: etag, validate_only: validate_only, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_principal_access_boundary_policy name: name, etag: etag, validate_only: validate_only, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_principal_access_boundary_policy ::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest.new(name: name, etag: etag, validate_only: validate_only, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_principal_access_boundary_policy({ name: name, etag: etag, validate_only: validate_only, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_principal_access_boundary_policy(::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest.new(name: name, etag: etag, validate_only: validate_only, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_principal_access_boundary_policy_client_stub.call_count + end + end + end + + def test_list_principal_access_boundary_policies + # Create test objects. + client_result = ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesResponse.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" + + list_principal_access_boundary_policies_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::ServiceStub.stub :transcode_list_principal_access_boundary_policies_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_principal_access_boundary_policies_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_principal_access_boundary_policies({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_principal_access_boundary_policies parent: parent, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_principal_access_boundary_policies ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_principal_access_boundary_policies({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_principal_access_boundary_policies(::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_principal_access_boundary_policies_client_stub.call_count + end + end + end + + def test_search_principal_access_boundary_policy_bindings + # Create test objects. + client_result = ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + page_size = 42 + page_token = "hello world" + + search_principal_access_boundary_policy_bindings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| + assert options.metadata.key? :"x-goog-api-client" + assert options.metadata[:"x-goog-api-client"].include? "rest" + refute options.metadata[:"x-goog-api-client"].include? "grpc" + end + + ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::ServiceStub.stub :transcode_search_principal_access_boundary_policy_bindings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_principal_access_boundary_policy_bindings_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_principal_access_boundary_policy_bindings({ name: name, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_principal_access_boundary_policy_bindings name: name, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_principal_access_boundary_policy_bindings ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest.new(name: name, page_size: page_size, page_token: page_token) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_principal_access_boundary_policy_bindings({ name: name, page_size: page_size, page_token: page_token }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_principal_access_boundary_policy_bindings(::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest.new(name: name, page_size: page_size, page_token: page_token), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_principal_access_boundary_policy_bindings_client_stub.call_count + end + end + end + + def test_configure + credentials_token = :dummy_value + + client = block_config = config = nil + dummy_stub = ClientStub.new nil + Gapic::Rest::ClientStub.stub :new, dummy_stub do + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| + config.credentials = credentials_token + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_test.rb new file mode 100644 index 000000000000..276b103f56aa --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_test.rb @@ -0,0 +1,515 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/iam/v3beta/principal_access_boundary_policies_service_pb" +require "google/iam/v3beta/principal_access_boundary_policies" + +class ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + catch :response do + yield @response, @operation if block_given? + @response + end + end + + def endpoint + "endpoint.example.com" + end + + def universe_domain + "example.com" + end + + def stub_logger + nil + end + + def logger + nil + end + end + + def test_create_principal_access_boundary_policy + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + principal_access_boundary_policy_id = "hello world" + principal_access_boundary_policy = {} + validate_only = true + + create_principal_access_boundary_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_principal_access_boundary_policy, name + assert_kind_of ::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["principal_access_boundary_policy_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy), request["principal_access_boundary_policy"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_principal_access_boundary_policy_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_principal_access_boundary_policy({ parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_principal_access_boundary_policy parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_principal_access_boundary_policy ::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest.new(parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_principal_access_boundary_policy({ parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_principal_access_boundary_policy(::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest.new(parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_principal_access_boundary_policy_client_stub.call_rpc_count + end + end + + def test_get_principal_access_boundary_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy.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_principal_access_boundary_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_principal_access_boundary_policy, name + assert_kind_of ::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_principal_access_boundary_policy_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_principal_access_boundary_policy({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_principal_access_boundary_policy name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_principal_access_boundary_policy ::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_principal_access_boundary_policy({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_principal_access_boundary_policy(::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest.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_principal_access_boundary_policy_client_stub.call_rpc_count + end + end + + def test_update_principal_access_boundary_policy + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + principal_access_boundary_policy = {} + validate_only = true + update_mask = {} + + update_principal_access_boundary_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_principal_access_boundary_policy, name + assert_kind_of ::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy), request["principal_access_boundary_policy"] + assert_equal true, request["validate_only"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_principal_access_boundary_policy_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_principal_access_boundary_policy({ principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_principal_access_boundary_policy principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_principal_access_boundary_policy ::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest.new(principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_principal_access_boundary_policy({ principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_principal_access_boundary_policy(::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest.new(principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_principal_access_boundary_policy_client_stub.call_rpc_count + end + end + + def test_delete_principal_access_boundary_policy + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + etag = "hello world" + validate_only = true + force = true + + delete_principal_access_boundary_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_principal_access_boundary_policy, name + assert_kind_of ::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + assert_equal true, request["validate_only"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_principal_access_boundary_policy_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_principal_access_boundary_policy({ name: name, etag: etag, validate_only: validate_only, force: force }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_principal_access_boundary_policy name: name, etag: etag, validate_only: validate_only, force: force do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_principal_access_boundary_policy ::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest.new(name: name, etag: etag, validate_only: validate_only, force: force) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_principal_access_boundary_policy({ name: name, etag: etag, validate_only: validate_only, force: force }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_principal_access_boundary_policy(::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest.new(name: name, etag: etag, validate_only: validate_only, force: force), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_principal_access_boundary_policy_client_stub.call_rpc_count + end + end + + def test_list_principal_access_boundary_policies + # Create GRPC objects. + grpc_response = ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesResponse.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" + + list_principal_access_boundary_policies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_principal_access_boundary_policies, name + assert_kind_of ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_principal_access_boundary_policies_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_principal_access_boundary_policies({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_principal_access_boundary_policies parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_principal_access_boundary_policies ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_principal_access_boundary_policies({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_principal_access_boundary_policies(::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_principal_access_boundary_policies_client_stub.call_rpc_count + end + end + + def test_search_principal_access_boundary_policy_bindings + # Create GRPC objects. + grpc_response = ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsResponse.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" + page_size = 42 + page_token = "hello world" + + search_principal_access_boundary_policy_bindings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_principal_access_boundary_policy_bindings, name + assert_kind_of ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_principal_access_boundary_policy_bindings_client_stub do + # Create client + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_principal_access_boundary_policy_bindings({ name: name, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_principal_access_boundary_policy_bindings name: name, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_principal_access_boundary_policy_bindings ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest.new(name: name, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_principal_access_boundary_policy_bindings({ name: name, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_principal_access_boundary_policy_bindings(::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest.new(name: name, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_principal_access_boundary_policy_bindings_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client::Configuration, config + end + + def test_credentials + key = OpenSSL::PKey::RSA.new 2048 + cred_json = { + "private_key" => key.to_pem, + "client_email" => "app@developer.gserviceaccount.com", + "type" => "service_account" + } + key_file = StringIO.new cred_json.to_json + creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) + + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client, client + assert_equal creds, client.configure.credentials + end + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + dummy_stub = ClientStub.new nil, nil + Gapic::ServiceStub.stub :new, dummy_stub do + client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-iam-v3beta/test/helper.rb b/owl-bot-staging/google-iam-v3beta/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-iam-v3beta/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 688ad891e96611e790ad04b68ecb86682b08a984 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 17 Apr 2026 21:05:47 +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 --- google-iam-v3beta/.owlbot-manifest.json | 33 +- google-iam-v3beta/.repo-metadata.json | 6 +- google-iam-v3beta/.rubocop.yml | 4 +- google-iam-v3beta/AUTHENTICATION.md | 14 +- google-iam-v3beta/README.md | 22 +- google-iam-v3beta/Rakefile | 26 +- google-iam-v3beta/gapic_metadata.json | 39 + .../google-cloud-iam-v3beta.gemspec | 0 google-iam-v3beta/google-iam-v3beta.gemspec | 29 - .../lib/google-cloud-iam-v3beta.rb | 0 google-iam-v3beta/lib/google-iam-v3beta.rb | 21 - .../lib/google/cloud/iam/v3beta/version.rb | 0 google-iam-v3beta/lib/google/iam/v3beta.rb | 7 +- .../lib/google/iam/v3beta/access_policies.rb | 0 .../iam/v3beta/access_policies/client.rb | 0 .../iam/v3beta/access_policies/credentials.rb | 0 .../iam/v3beta/access_policies/operations.rb | 0 .../iam/v3beta/access_policies/paths.rb | 0 .../google/iam/v3beta/access_policies/rest.rb | 0 .../iam/v3beta/access_policies/rest/client.rb | 0 .../v3beta/access_policies/rest/operations.rb | 0 .../access_policies/rest/service_stub.rb | 0 .../iam/v3beta/access_policies_service_pb.rb | 0 .../access_policies_service_services_pb.rb | 0 .../iam/v3beta/access_policy_resources_pb.rb | 0 .../iam/v3beta/policy_binding_resources_pb.rb | 2 +- .../lib/google/iam/v3beta/policy_bindings.rb | 2 +- .../iam/v3beta/policy_bindings/client.rb | 42 +- .../iam/v3beta/policy_bindings/operations.rb | 10 +- .../google/iam/v3beta/policy_bindings/rest.rb | 2 +- .../iam/v3beta/policy_bindings/rest/client.rb | 42 +- .../v3beta/policy_bindings/rest/operations.rb | 8 +- .../iam/v3beta/policy_bindings_service_pb.rb | 2 +- .../policy_bindings_service_services_pb.rb | 8 +- .../principal_access_boundary_policies.rb | 2 +- .../client.rb | 12 +- .../operations.rb | 10 +- .../rest.rb | 2 +- .../rest/client.rb | 12 +- .../rest/operations.rb | 8 +- .../lib/google/iam/v3beta/rest.rb | 5 +- .../iam/v3beta/access_policies_service.rb | 0 .../iam/v3beta/access_policy_resources.rb | 0 .../iam/v3beta/policy_binding_resources.rb | 78 +- .../iam/v3beta/policy_bindings_service.rb | 21 +- google-iam-v3beta/snippets/Gemfile | 4 +- .../access_policies/create_access_policy.rb | 0 .../access_policies/delete_access_policy.rb | 0 .../access_policies/get_access_policy.rb | 0 .../access_policies/list_access_policies.rb | 0 .../search_access_policy_bindings.rb | 0 .../access_policies/update_access_policy.rb | 0 .../snippet_metadata_google.iam.v3beta.json | 242 +++- .../v3beta/access_policies_operations_test.rb | 0 .../iam/v3beta/access_policies_paths_test.rb | 0 .../iam/v3beta/access_policies_rest_test.rb | 0 .../google/iam/v3beta/access_policies_test.rb | 0 .../iam/v3beta/policy_bindings_rest_test.rb | 11 +- .../google/iam/v3beta/policy_bindings_test.rb | 12 +- owl-bot-staging/google-iam-v3beta/.gitignore | 22 - .../google-iam-v3beta/.repo-metadata.json | 17 - .../google-iam-v3beta/.rubocop.yml | 33 - owl-bot-staging/google-iam-v3beta/.toys.rb | 28 - owl-bot-staging/google-iam-v3beta/.yardopts | 12 - .../google-iam-v3beta/AUTHENTICATION.md | 122 -- .../google-iam-v3beta/CHANGELOG.md | 2 - owl-bot-staging/google-iam-v3beta/Gemfile | 14 - owl-bot-staging/google-iam-v3beta/LICENSE.md | 201 --- owl-bot-staging/google-iam-v3beta/README.md | 154 --- owl-bot-staging/google-iam-v3beta/Rakefile | 169 --- .../google-iam-v3beta/gapic_metadata.json | 126 -- .../lib/google/iam/v3beta.rb | 45 - .../iam/v3beta/operation_metadata_pb.rb | 22 - .../iam/v3beta/policy_binding_resources_pb.rb | 27 - .../lib/google/iam/v3beta/policy_bindings.rb | 55 - .../iam/v3beta/policy_bindings/client.rb | 1155 ----------------- .../iam/v3beta/policy_bindings/credentials.rb | 45 - .../iam/v3beta/policy_bindings/operations.rb | 839 ------------ .../iam/v3beta/policy_bindings/paths.rb | 140 -- .../google/iam/v3beta/policy_bindings/rest.rb | 52 - .../iam/v3beta/policy_bindings/rest/client.rb | 1070 --------------- .../v3beta/policy_bindings/rest/operations.rb | 937 ------------- .../policy_bindings/rest/service_stub.rb | 535 -------- .../iam/v3beta/policy_bindings_service_pb.rb | 36 - .../policy_bindings_service_services_pb.rb | 61 - .../principal_access_boundary_policies.rb | 55 - .../client.rb | 1100 ---------------- .../credentials.rb | 45 - .../operations.rb | 839 ------------ .../paths.rb | 67 - .../rest.rb | 52 - .../rest/client.rb | 1015 --------------- .../rest/operations.rb | 937 ------------- .../rest/service_stub.rb | 447 ------- ...pal_access_boundary_policies_service_pb.rb | 37 - ...s_boundary_policies_service_services_pb.rb | 56 - ...pal_access_boundary_policy_resources_pb.rb | 27 - .../lib/google/iam/v3beta/rest.rb | 37 - .../google-iam-v3beta/proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 --------- .../proto_docs/google/api/field_behavior.rb | 85 -- .../proto_docs/google/api/field_info.rb | 88 -- .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 ---- .../google/iam/v3beta/operation_metadata.rb | 55 - .../iam/v3beta/policy_binding_resources.rb | 193 --- .../iam/v3beta/policy_bindings_service.rb | 243 ---- ...ncipal_access_boundary_policies_service.rb | 191 --- ...ncipal_access_boundary_policy_resources.rb | 127 -- .../google/longrunning/operations.rb | 191 --- .../proto_docs/google/protobuf/any.rb | 145 --- .../proto_docs/google/protobuf/duration.rb | 98 -- .../proto_docs/google/protobuf/empty.rb | 34 - .../proto_docs/google/protobuf/field_mask.rb | 229 ---- .../proto_docs/google/protobuf/timestamp.rb | 127 -- .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 -- .../google-iam-v3beta/snippets/Gemfile | 32 - .../policy_bindings/create_policy_binding.rb | 54 - .../policy_bindings/delete_policy_binding.rb | 54 - .../policy_bindings/get_policy_binding.rb | 47 - .../policy_bindings/list_policy_bindings.rb | 51 - .../search_target_policy_bindings.rb | 51 - .../policy_bindings/update_policy_binding.rb | 54 - ...create_principal_access_boundary_policy.rb | 54 - ...delete_principal_access_boundary_policy.rb | 54 - .../get_principal_access_boundary_policy.rb | 47 - ...list_principal_access_boundary_policies.rb | 51 - ...incipal_access_boundary_policy_bindings.rb | 51 - ...update_principal_access_boundary_policy.rb | 54 - .../snippet_metadata_google.iam.v3beta.json | 735 ----------- .../v3beta/policy_bindings_operations_test.rb | 400 ------ .../iam/v3beta/policy_bindings_paths_test.rb | 97 -- .../iam/v3beta/policy_bindings_rest_test.rb | 437 ------- .../google/iam/v3beta/policy_bindings_test.rb | 519 -------- ...ccess_boundary_policies_operations_test.rb | 400 ------ ...pal_access_boundary_policies_paths_test.rb | 67 - ...ipal_access_boundary_policies_rest_test.rb | 435 ------- ...principal_access_boundary_policies_test.rb | 515 -------- .../google-iam-v3beta/test/helper.rb | 26 - 140 files changed, 522 insertions(+), 17958 deletions(-) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/google-cloud-iam-v3beta.gemspec (100%) delete mode 100644 google-iam-v3beta/google-iam-v3beta.gemspec rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/lib/google-cloud-iam-v3beta.rb (100%) delete mode 100644 google-iam-v3beta/lib/google-iam-v3beta.rb rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/lib/google/cloud/iam/v3beta/version.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/lib/google/iam/v3beta/access_policies.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/lib/google/iam/v3beta/access_policies/client.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/lib/google/iam/v3beta/access_policies/credentials.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/lib/google/iam/v3beta/access_policies/operations.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/lib/google/iam/v3beta/access_policies/paths.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/lib/google/iam/v3beta/access_policies/rest.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/lib/google/iam/v3beta/access_policies/rest/client.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/lib/google/iam/v3beta/access_policies/rest/operations.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/lib/google/iam/v3beta/access_policies/rest/service_stub.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/lib/google/iam/v3beta/access_policies_service_pb.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/lib/google/iam/v3beta/access_policies_service_services_pb.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/lib/google/iam/v3beta/access_policy_resources_pb.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/proto_docs/google/iam/v3beta/access_policies_service.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/proto_docs/google/iam/v3beta/access_policy_resources.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/snippets/access_policies/create_access_policy.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/snippets/access_policies/delete_access_policy.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/snippets/access_policies/get_access_policy.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/snippets/access_policies/list_access_policies.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/snippets/access_policies/search_access_policy_bindings.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/snippets/access_policies/update_access_policy.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/test/google/iam/v3beta/access_policies_operations_test.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/test/google/iam/v3beta/access_policies_paths_test.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/test/google/iam/v3beta/access_policies_rest_test.rb (100%) rename {owl-bot-staging/google-iam-v3beta => google-iam-v3beta}/test/google/iam/v3beta/access_policies_test.rb (100%) delete mode 100644 owl-bot-staging/google-iam-v3beta/.gitignore delete mode 100644 owl-bot-staging/google-iam-v3beta/.repo-metadata.json delete mode 100644 owl-bot-staging/google-iam-v3beta/.rubocop.yml delete mode 100644 owl-bot-staging/google-iam-v3beta/.toys.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/.yardopts delete mode 100644 owl-bot-staging/google-iam-v3beta/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-iam-v3beta/CHANGELOG.md delete mode 100644 owl-bot-staging/google-iam-v3beta/Gemfile delete mode 100644 owl-bot-staging/google-iam-v3beta/LICENSE.md delete mode 100644 owl-bot-staging/google-iam-v3beta/README.md delete mode 100644 owl-bot-staging/google-iam-v3beta/Rakefile delete mode 100644 owl-bot-staging/google-iam-v3beta/gapic_metadata.json delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/operation_metadata_pb.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_binding_resources_pb.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/client.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/credentials.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/operations.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/paths.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/client.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/operations.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_pb.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_services_pb.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/client.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/credentials.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/operations.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/paths.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/client.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/operations.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies_service_pb.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies_service_services_pb.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policy_resources_pb.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/rest.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/README.md delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/operation_metadata.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_binding_resources.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_bindings_service.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/principal_access_boundary_policies_service.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/principal_access_boundary_policy_resources.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/snippets/Gemfile delete mode 100644 owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/create_policy_binding.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/delete_policy_binding.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/get_policy_binding.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/list_policy_bindings.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/search_target_policy_bindings.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/update_policy_binding.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/create_principal_access_boundary_policy.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/delete_principal_access_boundary_policy.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/get_principal_access_boundary_policy.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/list_principal_access_boundary_policies.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/search_principal_access_boundary_policy_bindings.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/update_principal_access_boundary_policy.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/snippets/snippet_metadata_google.iam.v3beta.json delete mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_operations_test.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_paths_test.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_rest_test.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_test.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_operations_test.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_paths_test.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_rest_test.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_test.rb delete mode 100644 owl-bot-staging/google-iam-v3beta/test/helper.rb diff --git a/google-iam-v3beta/.owlbot-manifest.json b/google-iam-v3beta/.owlbot-manifest.json index 16ff0d5b1a53..94a80bd15cd8 100644 --- a/google-iam-v3beta/.owlbot-manifest.json +++ b/google-iam-v3beta/.owlbot-manifest.json @@ -12,9 +12,22 @@ "README.md", "Rakefile", "gapic_metadata.json", - "google-iam-v3beta.gemspec", - "lib/google-iam-v3beta.rb", + "google-cloud-iam-v3beta.gemspec", + "lib/google-cloud-iam-v3beta.rb", + "lib/google/cloud/iam/v3beta/version.rb", "lib/google/iam/v3beta.rb", + "lib/google/iam/v3beta/access_policies.rb", + "lib/google/iam/v3beta/access_policies/client.rb", + "lib/google/iam/v3beta/access_policies/credentials.rb", + "lib/google/iam/v3beta/access_policies/operations.rb", + "lib/google/iam/v3beta/access_policies/paths.rb", + "lib/google/iam/v3beta/access_policies/rest.rb", + "lib/google/iam/v3beta/access_policies/rest/client.rb", + "lib/google/iam/v3beta/access_policies/rest/operations.rb", + "lib/google/iam/v3beta/access_policies/rest/service_stub.rb", + "lib/google/iam/v3beta/access_policies_service_pb.rb", + "lib/google/iam/v3beta/access_policies_service_services_pb.rb", + "lib/google/iam/v3beta/access_policy_resources_pb.rb", "lib/google/iam/v3beta/operation_metadata_pb.rb", "lib/google/iam/v3beta/policy_binding_resources_pb.rb", "lib/google/iam/v3beta/policy_bindings.rb", @@ -41,13 +54,14 @@ "lib/google/iam/v3beta/principal_access_boundary_policies_service_services_pb.rb", "lib/google/iam/v3beta/principal_access_boundary_policy_resources_pb.rb", "lib/google/iam/v3beta/rest.rb", - "lib/google/iam/v3beta/version.rb", "proto_docs/README.md", "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", "proto_docs/google/api/field_info.rb", "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", + "proto_docs/google/iam/v3beta/access_policies_service.rb", + "proto_docs/google/iam/v3beta/access_policy_resources.rb", "proto_docs/google/iam/v3beta/operation_metadata.rb", "proto_docs/google/iam/v3beta/policy_binding_resources.rb", "proto_docs/google/iam/v3beta/policy_bindings_service.rb", @@ -62,6 +76,12 @@ "proto_docs/google/rpc/status.rb", "proto_docs/google/type/expr.rb", "snippets/Gemfile", + "snippets/access_policies/create_access_policy.rb", + "snippets/access_policies/delete_access_policy.rb", + "snippets/access_policies/get_access_policy.rb", + "snippets/access_policies/list_access_policies.rb", + "snippets/access_policies/search_access_policy_bindings.rb", + "snippets/access_policies/update_access_policy.rb", "snippets/policy_bindings/create_policy_binding.rb", "snippets/policy_bindings/delete_policy_binding.rb", "snippets/policy_bindings/get_policy_binding.rb", @@ -75,6 +95,10 @@ "snippets/principal_access_boundary_policies/search_principal_access_boundary_policy_bindings.rb", "snippets/principal_access_boundary_policies/update_principal_access_boundary_policy.rb", "snippets/snippet_metadata_google.iam.v3beta.json", + "test/google/iam/v3beta/access_policies_operations_test.rb", + "test/google/iam/v3beta/access_policies_paths_test.rb", + "test/google/iam/v3beta/access_policies_rest_test.rb", + "test/google/iam/v3beta/access_policies_test.rb", "test/google/iam/v3beta/policy_bindings_operations_test.rb", "test/google/iam/v3beta/policy_bindings_paths_test.rb", "test/google/iam/v3beta/policy_bindings_rest_test.rb", @@ -86,6 +110,7 @@ "test/helper.rb" ], "static": [ - ".OwlBot.yaml" + ".OwlBot.yaml", + "lib/google/iam/v3beta/version.rb" ] } diff --git a/google-iam-v3beta/.repo-metadata.json b/google-iam-v3beta/.repo-metadata.json index 93cab105a70f..8b436ae98da4 100644 --- a/google-iam-v3beta/.repo-metadata.json +++ b/google-iam-v3beta/.repo-metadata.json @@ -1,8 +1,8 @@ { "api_id": "iam.googleapis.com", "api_shortname": "iam", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-iam-v3beta/latest", - "distribution_name": "google-iam-v3beta", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-iam-v3beta/latest", + "distribution_name": "google-cloud-iam-v3beta", "is_cloud": true, "language": "ruby", "name": "iam", @@ -11,7 +11,7 @@ "release_level": "preview", "repo": "googleapis/google-cloud-ruby", "requires_billing": true, - "ruby-cloud-description": "Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API. Note that google-iam-v3beta is a version-specific client library. For most uses, we recommend installing the main client library google-iam instead. See the readme for more details.", + "ruby-cloud-description": "Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API. Note that google-cloud-iam-v3beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-iam instead. See the readme for more details.", "ruby-cloud-product-url": "https://cloud.google.com/iam/docs/overview", "library_type": "GAPIC_AUTO" } diff --git a/google-iam-v3beta/.rubocop.yml b/google-iam-v3beta/.rubocop.yml index b142b763dfa7..efbd005346b3 100644 --- a/google-iam-v3beta/.rubocop.yml +++ b/google-iam-v3beta/.rubocop.yml @@ -3,7 +3,7 @@ inherit_gem: AllCops: Exclude: - - "google-iam-v3beta.gemspec" + - "google-cloud-iam-v3beta.gemspec" - "lib/**/*_pb.rb" - "proto_docs/**/*" - "test/**/*" @@ -30,4 +30,4 @@ Naming/AccessorMethodName: - "snippets/**/*.rb" Naming/FileName: Exclude: - - "lib/google-iam-v3beta.rb" + - "lib/google-cloud-iam-v3beta.rb" diff --git a/google-iam-v3beta/AUTHENTICATION.md b/google-iam-v3beta/AUTHENTICATION.md index 27d31ca1f47f..ff7654b6751d 100644 --- a/google-iam-v3beta/AUTHENTICATION.md +++ b/google-iam-v3beta/AUTHENTICATION.md @@ -1,6 +1,6 @@ # Authentication -The recommended way to authenticate to the google-iam-v3beta library is to use +The recommended way to authenticate to the google-cloud-iam-v3beta 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). @@ -26,7 +26,7 @@ For more information about setting up authentication for a local development env ## Credential Lookup -The google-iam-v3beta library provides several mechanisms to configure your system. +The google-cloud-iam-v3beta 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. @@ -56,7 +56,7 @@ To configure a credentials file for an individual client initialization: ```ruby require "google/iam/v3beta" -client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| +client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| config.credentials = "path/to/credentialfile.json" end ``` @@ -66,11 +66,11 @@ To configure a credentials file globally for all clients: ```ruby require "google/iam/v3beta" -::Google::Iam::V3beta::PolicyBindings::Client.configure do |config| +::Google::Iam::V3beta::AccessPolicies::Client.configure do |config| config.credentials = "path/to/credentialfile.json" end -client = ::Google::Iam::V3beta::PolicyBindings::Client.new +client = ::Google::Iam::V3beta::AccessPolicies::Client.new ``` ### Environment Variables @@ -89,7 +89,7 @@ Note: Service account keys are a security risk if not managed correctly. You sho [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-iam-v3beta +The environment variables that google-cloud-iam-v3beta checks for credentials are: * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents @@ -100,7 +100,7 @@ require "google/iam/v3beta" ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" -client = ::Google::Iam::V3beta::PolicyBindings::Client.new +client = ::Google::Iam::V3beta::AccessPolicies::Client.new ``` ### Local ADC file diff --git a/google-iam-v3beta/README.md b/google-iam-v3beta/README.md index cba8c6d0bb77..f708122c6c3a 100644 --- a/google-iam-v3beta/README.md +++ b/google-iam-v3beta/README.md @@ -9,13 +9,13 @@ https://github.com/googleapis/google-cloud-ruby This gem is a _versioned_ client. It provides basic client classes for a specific version of the Identity and Access Management (IAM) V3BETA API. Most users should consider using the main client gem, -[google-iam](https://rubygems.org/gems/google-iam). +[google-cloud-iam](https://rubygems.org/gems/google-cloud-iam). See the section below titled *Which client should I use?* for more information. ## Installation ``` -$ gem install google-iam-v3beta +$ gem install google-cloud-iam-v3beta ``` ## Before You Begin @@ -32,12 +32,12 @@ In order to use this library, you first need to go through the following steps: ```ruby require "google/iam/v3beta" -client = ::Google::Iam::V3beta::PolicyBindings::Client.new -request = ::Google::Iam::V3beta::CreatePolicyBindingRequest.new # (request fields as keyword arguments...) -response = client.create_policy_binding request +client = ::Google::Iam::V3beta::AccessPolicies::Client.new +request = ::Google::Iam::V3beta::CreateAccessPolicyRequest.new # (request fields as keyword arguments...) +response = client.create_access_policy request ``` -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-iam-v3beta/latest) +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-iam-v3beta/latest) for class and method documentation. See also the [Product Documentation](https://cloud.google.com/iam/docs/overview) @@ -75,7 +75,7 @@ constructing a client object. For example: require "google/iam/v3beta" require "logger" -client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| +client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| config.logger = Logger.new "my-app.log" end ``` @@ -98,9 +98,9 @@ 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-iam`, +client library with a name such as `google-cloud-iam`, and lower-level _versioned_ client libraries with names such as -`google-iam-v3beta`. +`google-cloud-iam-v3beta`. _In most cases, you should install the main client._ ### What's the difference between the main client and a versioned client? @@ -125,7 +125,7 @@ service version. 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-iam`. +`google-cloud-iam`. 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 @@ -138,7 +138,7 @@ 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-iam-v3beta`. +is part of the name, e.g. `google-cloud-iam-v3beta`. ### What about the google-apis- clients? diff --git a/google-iam-v3beta/Rakefile b/google-iam-v3beta/Rakefile index 381a7cce87a4..dd6bd1c27699 100644 --- a/google-iam-v3beta/Rakefile +++ b/google-iam-v3beta/Rakefile @@ -37,7 +37,7 @@ Rake::TestTask.new :smoke_test do |t| end # Acceptance tests -desc "Run the google-iam-v3beta acceptance tests." +desc "Run the google-cloud-iam-v3beta acceptance tests." task :acceptance, :project, :keyfile do |t, args| project = args[:project] project ||= @@ -57,8 +57,8 @@ task :acceptance, :project, :keyfile do |t, args| if project.nil? || keyfile.nil? fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" end - require "google/iam/v3beta/policy_bindings/credentials" - ::Google::Iam::V3beta::PolicyBindings::Credentials.env_vars.each do |path| + require "google/iam/v3beta/access_policies/credentials" + ::Google::Iam::V3beta::AccessPolicies::Credentials.env_vars.each do |path| ENV[path] = nil end ENV["GOOGLE_CLOUD_PROJECT"] = project @@ -73,7 +73,7 @@ namespace :acceptance do if File.directory? "acceptance" Rake::Task[:smoke_test].invoke else - puts "The google-iam-v3beta gem has no acceptance tests." + puts "The google-cloud-iam-v3beta gem has no acceptance tests." end end @@ -97,7 +97,7 @@ namespace :samples do end end else - puts "The google-iam-v3beta gem has no samples to test." + puts "The google-cloud-iam-v3beta gem has no samples to test." end end @@ -111,7 +111,7 @@ namespace :samples do end end else - puts "The google-iam-v3beta gem has no samples to test." + puts "The google-cloud-iam-v3beta gem has no samples to test." end end end @@ -124,17 +124,17 @@ end desc "Run yard-doctest example tests." task :doctest do - puts "The google-iam-v3beta gem does not have doctest tests." + puts "The google-cloud-iam-v3beta gem does not have doctest tests." end desc "Run the CI build" task :ci do - header "BUILDING google-iam-v3beta" - header "google-iam-v3beta rubocop", "*" + header "BUILDING google-cloud-iam-v3beta" + header "google-cloud-iam-v3beta rubocop", "*" Rake::Task[:rubocop].invoke - header "google-iam-v3beta yard", "*" + header "google-cloud-iam-v3beta yard", "*" Rake::Task[:yard].invoke - header "google-iam-v3beta test", "*" + header "google-cloud-iam-v3beta test", "*" Rake::Task[:test].invoke end @@ -142,13 +142,13 @@ namespace :ci do desc "Run the CI build, with smoke tests." task :smoke_test do Rake::Task[:ci].invoke - header "google-iam-v3beta smoke_test", "*" + header "google-cloud-iam-v3beta 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-iam-v3beta acceptance", "*" + header "google-cloud-iam-v3beta acceptance", "*" Rake::Task[:acceptance].invoke end task :a do diff --git a/google-iam-v3beta/gapic_metadata.json b/google-iam-v3beta/gapic_metadata.json index 5aec57c62173..13391b62f322 100644 --- a/google-iam-v3beta/gapic_metadata.json +++ b/google-iam-v3beta/gapic_metadata.json @@ -5,6 +5,45 @@ "protoPackage": "google.iam.v3beta", "libraryPackage": "::Google::Iam::V3beta", "services": { + "AccessPolicies": { + "clients": { + "grpc": { + "libraryClient": "::Google::Iam::V3beta::AccessPolicies::Client", + "rpcs": { + "CreateAccessPolicy": { + "methods": [ + "create_access_policy" + ] + }, + "GetAccessPolicy": { + "methods": [ + "get_access_policy" + ] + }, + "UpdateAccessPolicy": { + "methods": [ + "update_access_policy" + ] + }, + "DeleteAccessPolicy": { + "methods": [ + "delete_access_policy" + ] + }, + "ListAccessPolicies": { + "methods": [ + "list_access_policies" + ] + }, + "SearchAccessPolicyBindings": { + "methods": [ + "search_access_policy_bindings" + ] + } + } + } + } + }, "PolicyBindings": { "clients": { "grpc": { diff --git a/owl-bot-staging/google-iam-v3beta/google-cloud-iam-v3beta.gemspec b/google-iam-v3beta/google-cloud-iam-v3beta.gemspec similarity index 100% rename from owl-bot-staging/google-iam-v3beta/google-cloud-iam-v3beta.gemspec rename to google-iam-v3beta/google-cloud-iam-v3beta.gemspec diff --git a/google-iam-v3beta/google-iam-v3beta.gemspec b/google-iam-v3beta/google-iam-v3beta.gemspec deleted file mode 100644 index 17bc1cf0bcb8..000000000000 --- a/google-iam-v3beta/google-iam-v3beta.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/iam/v3beta/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-iam-v3beta" - gem.version = Google::Iam::V3beta::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API. Note that google-iam-v3beta is a version-specific client library. For most uses, we recommend installing the main client library google-iam instead. See the readme for more details." - gem.summary = "Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API." - gem.homepage = "https://github.com/googleapis/google-cloud-ruby" - gem.license = "Apache-2.0" - - gem.platform = Gem::Platform::RUBY - - gem.files = `git ls-files -- lib/*`.split("\n") + - `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.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google-cloud-iam-v3beta.rb b/google-iam-v3beta/lib/google-cloud-iam-v3beta.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/lib/google-cloud-iam-v3beta.rb rename to google-iam-v3beta/lib/google-cloud-iam-v3beta.rb diff --git a/google-iam-v3beta/lib/google-iam-v3beta.rb b/google-iam-v3beta/lib/google-iam-v3beta.rb deleted file mode 100644 index 30f210f5cac7..000000000000 --- a/google-iam-v3beta/lib/google-iam-v3beta.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# This gem does not autoload during Bundler.require. To load this gem, -# issue explicit require statements for the packages desired, e.g.: -# require "google/iam/v3beta" diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/cloud/iam/v3beta/version.rb b/google-iam-v3beta/lib/google/cloud/iam/v3beta/version.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/lib/google/cloud/iam/v3beta/version.rb rename to google-iam-v3beta/lib/google/cloud/iam/v3beta/version.rb diff --git a/google-iam-v3beta/lib/google/iam/v3beta.rb b/google-iam-v3beta/lib/google/iam/v3beta.rb index 40867bb6556e..dd4a67511d55 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta.rb @@ -16,9 +16,10 @@ # Auto-generated by gapic-generator-ruby. DO NOT EDIT! +require "google/iam/v3beta/access_policies" require "google/iam/v3beta/policy_bindings" require "google/iam/v3beta/principal_access_boundary_policies" -require "google/iam/v3beta/version" +require "google/cloud/iam/v3beta/version" module Google module Iam @@ -28,12 +29,12 @@ module Iam # @example Load this package, including all its services, and instantiate a gRPC client # # require "google/iam/v3beta" - # client = ::Google::Iam::V3beta::PolicyBindings::Client.new + # client = ::Google::Iam::V3beta::AccessPolicies::Client.new # # @example Load this package, including all its services, and instantiate a REST client # # require "google/iam/v3beta" - # client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new + # client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new # module V3beta end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies.rb b/google-iam-v3beta/lib/google/iam/v3beta/access_policies.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies.rb rename to google-iam-v3beta/lib/google/iam/v3beta/access_policies.rb diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/client.rb b/google-iam-v3beta/lib/google/iam/v3beta/access_policies/client.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/client.rb rename to google-iam-v3beta/lib/google/iam/v3beta/access_policies/client.rb diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/credentials.rb b/google-iam-v3beta/lib/google/iam/v3beta/access_policies/credentials.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/credentials.rb rename to google-iam-v3beta/lib/google/iam/v3beta/access_policies/credentials.rb diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/operations.rb b/google-iam-v3beta/lib/google/iam/v3beta/access_policies/operations.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/operations.rb rename to google-iam-v3beta/lib/google/iam/v3beta/access_policies/operations.rb diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/paths.rb b/google-iam-v3beta/lib/google/iam/v3beta/access_policies/paths.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/paths.rb rename to google-iam-v3beta/lib/google/iam/v3beta/access_policies/paths.rb diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest.rb b/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest.rb rename to google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest.rb diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/client.rb b/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/client.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/client.rb rename to google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/client.rb diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/operations.rb b/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/operations.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/operations.rb rename to google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/operations.rb diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/service_stub.rb b/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/service_stub.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/service_stub.rb rename to google-iam-v3beta/lib/google/iam/v3beta/access_policies/rest/service_stub.rb diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies_service_pb.rb b/google-iam-v3beta/lib/google/iam/v3beta/access_policies_service_pb.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies_service_pb.rb rename to google-iam-v3beta/lib/google/iam/v3beta/access_policies_service_pb.rb diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies_service_services_pb.rb b/google-iam-v3beta/lib/google/iam/v3beta/access_policies_service_services_pb.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policies_service_services_pb.rb rename to google-iam-v3beta/lib/google/iam/v3beta/access_policies_service_services_pb.rb diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policy_resources_pb.rb b/google-iam-v3beta/lib/google/iam/v3beta/access_policy_resources_pb.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/access_policy_resources_pb.rb rename to google-iam-v3beta/lib/google/iam/v3beta/access_policy_resources_pb.rb diff --git a/google-iam-v3beta/lib/google/iam/v3beta/policy_binding_resources_pb.rb b/google-iam-v3beta/lib/google/iam/v3beta/policy_binding_resources_pb.rb index 8062797ff505..ec1093319476 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta/policy_binding_resources_pb.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta/policy_binding_resources_pb.rb @@ -11,7 +11,7 @@ require 'google/type/expr_pb' -descriptor_data = "\n0google/iam/v3beta/policy_binding_resources.proto\x12\x11google.iam.v3beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x16google/type/expr.proto\"\xe2\x07\n\rPolicyBinding\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x18\n\x03uid\x18\x02 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12K\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x31.google.iam.v3beta.PolicyBinding.AnnotationsEntryB\x03\xe0\x41\x01\x12?\n\x06target\x18\x06 \x01(\x0b\x32\'.google.iam.v3beta.PolicyBinding.TargetB\x06\xe0\x41\x05\xe0\x41\x02\x12\x45\n\x0bpolicy_kind\x18\x0b \x01(\x0e\x32+.google.iam.v3beta.PolicyBinding.PolicyKindB\x03\xe0\x41\x05\x12\x16\n\x06policy\x18\x07 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x02\x12\x17\n\npolicy_uid\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12)\n\tcondition\x18\x08 \x01(\x0b\x32\x11.google.type.ExprB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1a\x30\n\x06Target\x12\x1c\n\rprincipal_set\x18\x01 \x01(\tB\x03\xe0\x41\x05H\x00\x42\x08\n\x06target\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"H\n\nPolicyKind\x12\x1b\n\x17POLICY_KIND_UNSPECIFIED\x10\x00\x12\x1d\n\x19PRINCIPAL_ACCESS_BOUNDARY\x10\x01:\xa8\x02\xea\x41\xa4\x02\n iam.googleapis.com/PolicyBinding\x12Qorganizations/{organization}/locations/{location}/policyBindings/{policy_binding}\x12\x45\x66olders/{folder}/locations/{location}/policyBindings/{policy_binding}\x12Gprojects/{project}/locations/{location}/policyBindings/{policy_binding}*\x0epolicyBindings2\rpolicyBindingB\x99\x01\n\x15\x63om.google.iam.v3betaB\x1bPolicyBindingResourcesProtoP\x01Z-cloud.google.com/go/iam/apiv3beta/iampb;iampb\xaa\x02\x17Google.Cloud.Iam.V3Beta\xca\x02\x17Google\\Cloud\\Iam\\V3betab\x06proto3" +descriptor_data = "\n0google/iam/v3beta/policy_binding_resources.proto\x12\x11google.iam.v3beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x16google/type/expr.proto\"\x87\x08\n\rPolicyBinding\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x18\n\x03uid\x18\x02 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12K\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x31.google.iam.v3beta.PolicyBinding.AnnotationsEntryB\x03\xe0\x41\x01\x12?\n\x06target\x18\x06 \x01(\x0b\x32\'.google.iam.v3beta.PolicyBinding.TargetB\x06\xe0\x41\x05\xe0\x41\x02\x12\x45\n\x0bpolicy_kind\x18\x0b \x01(\x0e\x32+.google.iam.v3beta.PolicyBinding.PolicyKindB\x03\xe0\x41\x05\x12\x16\n\x06policy\x18\x07 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x02\x12\x17\n\npolicy_uid\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12)\n\tcondition\x18\x08 \x01(\x0b\x32\x11.google.type.ExprB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1aI\n\x06Target\x12\x1c\n\rprincipal_set\x18\x01 \x01(\tB\x03\xe0\x41\x05H\x00\x12\x17\n\x08resource\x18\x02 \x01(\tB\x03\xe0\x41\x05H\x00\x42\x08\n\x06target\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\nPolicyKind\x12\x1b\n\x17POLICY_KIND_UNSPECIFIED\x10\x00\x12\x1d\n\x19PRINCIPAL_ACCESS_BOUNDARY\x10\x01\x12\n\n\x06\x41\x43\x43\x45SS\x10\x02:\xa8\x02\xea\x41\xa4\x02\n iam.googleapis.com/PolicyBinding\x12Qorganizations/{organization}/locations/{location}/policyBindings/{policy_binding}\x12\x45\x66olders/{folder}/locations/{location}/policyBindings/{policy_binding}\x12Gprojects/{project}/locations/{location}/policyBindings/{policy_binding}*\x0epolicyBindings2\rpolicyBindingB\x99\x01\n\x15\x63om.google.iam.v3betaB\x1bPolicyBindingResourcesProtoP\x01Z-cloud.google.com/go/iam/apiv3beta/iampb;iampb\xaa\x02\x17Google.Cloud.Iam.V3Beta\xca\x02\x17Google\\Cloud\\Iam\\V3betab\x06proto3" pool = ::Google::Protobuf::DescriptorPool.generated_pool pool.add_serialized_file(descriptor_data) diff --git a/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings.rb b/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings.rb index 14760bb14ac2..7379275c3ade 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings.rb @@ -20,7 +20,7 @@ require "gapic/config" require "gapic/config/method" -require "google/iam/v3beta/version" +require "google/cloud/iam/v3beta/version" require "google/iam/v3beta/policy_bindings/credentials" require "google/iam/v3beta/policy_bindings/paths" diff --git a/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/client.rb b/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/client.rb index e090eeac5823..f8c5567eb445 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/client.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/client.rb @@ -237,7 +237,7 @@ def logger ## # Creates a policy binding and returns a long-running operation. # Callers will need the IAM permissions on both the policy and target. - # Once the binding is created, the policy is applied to the target. + # After the binding is created, the policy is applied to the target. # # @overload create_policy_binding(request, options = nil) # Pass arguments to `create_policy_binding` via a request object, either of type @@ -322,7 +322,7 @@ def create_policy_binding request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -416,7 +416,7 @@ def get_policy_binding request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -446,9 +446,7 @@ def get_policy_binding request, options = nil ## # Updates a policy binding and returns a long-running operation. # Callers will need the IAM permissions on the policy and target in the - # binding to update, and the IAM permission to remove the existing policy - # from the binding. Target is immutable and cannot be updated. Once the - # binding is updated, the new policy is applied to the target. + # binding to update. Target and policy are immutable and cannot be updated. # # @overload update_policy_binding(request, options = nil) # Pass arguments to `update_policy_binding` via a request object, either of type @@ -520,7 +518,7 @@ def update_policy_binding request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -552,7 +550,7 @@ def update_policy_binding request, options = nil ## # Deletes a policy binding and returns a long-running operation. # Callers will need the IAM permissions on both the policy and target. - # Once the binding is deleted, the policy no longer applies to the target. + # After the binding is deleted, the policy no longer applies to the target. # # @overload delete_policy_binding(request, options = nil) # Pass arguments to `delete_policy_binding` via a request object, either of type @@ -629,7 +627,7 @@ def delete_policy_binding request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -690,8 +688,7 @@ def delete_policy_binding request, options = nil # Optional. The maximum number of policy bindings to return. The service may # return fewer than this value. # - # If unspecified, at most 50 policy bindings will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. + # The default value is 50. The maximum value is 1000. # @param page_token [::String] # Optional. A page token, received from a previous `ListPolicyBindings` call. # Provide this to retrieve the subsequent page. @@ -700,7 +697,8 @@ def delete_policy_binding request, options = nil # match the call that provided the page token. # @param filter [::String] # Optional. An expression for filtering the results of the request. Filter - # rules are case insensitive. Some eligible fields for filtering are: + # rules are case insensitive. Some eligible fields for filtering are the + # following: # # + `target` # + `policy` @@ -752,7 +750,7 @@ def list_policy_bindings request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -795,7 +793,7 @@ def list_policy_bindings request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload search_target_policy_bindings(target: nil, page_size: nil, page_token: nil, parent: nil) + # @overload search_target_policy_bindings(target: nil, page_size: nil, page_token: nil, parent: nil, filter: nil) # Pass arguments to `search_target_policy_bindings` 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). @@ -815,8 +813,7 @@ def list_policy_bindings request, options = nil # Optional. The maximum number of policy bindings to return. The service may # return fewer than this value. # - # If unspecified, at most 50 policy bindings will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. + # The default value is 50. The maximum value is 1000. # @param page_token [::String] # Optional. A page token, received from a previous # `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the @@ -836,6 +833,17 @@ def list_policy_bindings request, options = nil # * `projects/{project_number}/locations/{location}` # * `folders/{folder_id}/locations/{location}` # * `organizations/{organization_id}/locations/{location}` + # @param filter [::String] + # Optional. Filtering currently only supports the kind of policies to return, + # and must be in the format "policy_kind=\\{policy_kind}". + # + # If String is empty, bindings bound to all kinds of policies would be + # returned. + # + # The only supported values are the following: + # + # * "policy_kind=PRINCIPAL_ACCESS_BOUNDARY", + # * "policy_kind=ACCESS" # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] @@ -878,7 +886,7 @@ def search_target_policy_bindings request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id diff --git a/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/operations.rb b/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/operations.rb index 967476c55eb3..a726d37bc697 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/operations.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/operations.rb @@ -199,7 +199,7 @@ def list_operations request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -296,7 +296,7 @@ def get_operation request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -386,7 +386,7 @@ def delete_operation request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -481,7 +481,7 @@ def cancel_operation request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -585,7 +585,7 @@ def wait_operation request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id diff --git a/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest.rb b/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest.rb index a419663fb807..de364a77d181 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest.rb @@ -20,7 +20,7 @@ require "gapic/config" require "gapic/config/method" -require "google/iam/v3beta/version" +require "google/cloud/iam/v3beta/version" require "google/iam/v3beta/policy_bindings/credentials" require "google/iam/v3beta/policy_bindings/paths" diff --git a/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/client.rb b/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/client.rb index a3d9a590a422..3967991ff656 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/client.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/client.rb @@ -230,7 +230,7 @@ def logger ## # Creates a policy binding and returns a long-running operation. # Callers will need the IAM permissions on both the policy and target. - # Once the binding is created, the policy is applied to the target. + # After the binding is created, the policy is applied to the target. # # @overload create_policy_binding(request, options = nil) # Pass arguments to `create_policy_binding` via a request object, either of type @@ -314,7 +314,7 @@ def create_policy_binding request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? @@ -401,7 +401,7 @@ def get_policy_binding request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? @@ -425,9 +425,7 @@ def get_policy_binding request, options = nil ## # Updates a policy binding and returns a long-running operation. # Callers will need the IAM permissions on the policy and target in the - # binding to update, and the IAM permission to remove the existing policy - # from the binding. Target is immutable and cannot be updated. Once the - # binding is updated, the new policy is applied to the target. + # binding to update. Target and policy are immutable and cannot be updated. # # @overload update_policy_binding(request, options = nil) # Pass arguments to `update_policy_binding` via a request object, either of type @@ -498,7 +496,7 @@ def update_policy_binding request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? @@ -524,7 +522,7 @@ def update_policy_binding request, options = nil ## # Deletes a policy binding and returns a long-running operation. # Callers will need the IAM permissions on both the policy and target. - # Once the binding is deleted, the policy no longer applies to the target. + # After the binding is deleted, the policy no longer applies to the target. # # @overload delete_policy_binding(request, options = nil) # Pass arguments to `delete_policy_binding` via a request object, either of type @@ -600,7 +598,7 @@ def delete_policy_binding request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? @@ -655,8 +653,7 @@ def delete_policy_binding request, options = nil # Optional. The maximum number of policy bindings to return. The service may # return fewer than this value. # - # If unspecified, at most 50 policy bindings will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. + # The default value is 50. The maximum value is 1000. # @param page_token [::String] # Optional. A page token, received from a previous `ListPolicyBindings` call. # Provide this to retrieve the subsequent page. @@ -665,7 +662,8 @@ def delete_policy_binding request, options = nil # match the call that provided the page token. # @param filter [::String] # Optional. An expression for filtering the results of the request. Filter - # rules are case insensitive. Some eligible fields for filtering are: + # rules are case insensitive. Some eligible fields for filtering are the + # following: # # + `target` # + `policy` @@ -716,7 +714,7 @@ def list_policy_bindings request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? @@ -753,7 +751,7 @@ def list_policy_bindings request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. # - # @overload search_target_policy_bindings(target: nil, page_size: nil, page_token: nil, parent: nil) + # @overload search_target_policy_bindings(target: nil, page_size: nil, page_token: nil, parent: nil, filter: nil) # Pass arguments to `search_target_policy_bindings` 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). @@ -773,8 +771,7 @@ def list_policy_bindings request, options = nil # Optional. The maximum number of policy bindings to return. The service may # return fewer than this value. # - # If unspecified, at most 50 policy bindings will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. + # The default value is 50. The maximum value is 1000. # @param page_token [::String] # Optional. A page token, received from a previous # `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the @@ -794,6 +791,17 @@ def list_policy_bindings request, options = nil # * `projects/{project_number}/locations/{location}` # * `folders/{folder_id}/locations/{location}` # * `organizations/{organization_id}/locations/{location}` + # @param filter [::String] + # Optional. Filtering currently only supports the kind of policies to return, + # and must be in the format "policy_kind=\\{policy_kind}". + # + # If String is empty, bindings bound to all kinds of policies would be + # returned. + # + # The only supported values are the following: + # + # * "policy_kind=PRINCIPAL_ACCESS_BOUNDARY", + # * "policy_kind=ACCESS" # @yield [result, operation] Access the result along with the TransportOperation object # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] # @yieldparam operation [::Gapic::Rest::TransportOperation] @@ -835,7 +843,7 @@ def search_target_policy_bindings request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? diff --git a/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/operations.rb b/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/operations.rb index f726edbcaa6e..f87ef9d848f6 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/operations.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/operations.rb @@ -189,7 +189,7 @@ def list_operations request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? @@ -278,7 +278,7 @@ def get_operation request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? @@ -361,7 +361,7 @@ def delete_operation request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? @@ -449,7 +449,7 @@ def cancel_operation request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? diff --git a/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_pb.rb b/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_pb.rb index 0398541a7af3..6c9513bee8e7 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_pb.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_pb.rb @@ -15,7 +15,7 @@ require 'google/protobuf/field_mask_pb' -descriptor_data = "\n/google/iam/v3beta/policy_bindings_service.proto\x12\x11google.iam.v3beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/iam/v3beta/operation_metadata.proto\x1a\x30google/iam/v3beta/policy_binding_resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xd1\x01\n\x1a\x43reatePolicyBindingRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 iam.googleapis.com/PolicyBinding\x12\x1e\n\x11policy_binding_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12=\n\x0epolicy_binding\x18\x03 \x01(\x0b\x32 .google.iam.v3beta.PolicyBindingB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"Q\n\x17GetPolicyBindingRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n iam.googleapis.com/PolicyBinding\"\xad\x01\n\x1aUpdatePolicyBindingRequest\x12=\n\x0epolicy_binding\x18\x01 \x01(\x0b\x32 .google.iam.v3beta.PolicyBindingB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x83\x01\n\x1a\x44\x65letePolicyBindingRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n iam.googleapis.com/PolicyBinding\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x9b\x01\n\x19ListPolicyBindingsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 iam.googleapis.com/PolicyBinding\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\"u\n\x1aListPolicyBindingsResponse\x12\x39\n\x0fpolicy_bindings\x18\x01 \x03(\x0b\x32 .google.iam.v3beta.PolicyBinding\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xa3\x01\n!SearchTargetPolicyBindingsRequest\x12\x13\n\x06target\x18\x01 \x01(\tB\x03\xe0\x41\x02\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\x38\n\x06parent\x18\x05 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 iam.googleapis.com/PolicyBinding\"}\n\"SearchTargetPolicyBindingsResponse\x12\x39\n\x0fpolicy_bindings\x18\x01 \x03(\x0b\x32 .google.iam.v3beta.PolicyBinding\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x32\x8c\x12\n\x0ePolicyBindings\x12\x9c\x03\n\x13\x43reatePolicyBinding\x12-.google.iam.v3beta.CreatePolicyBindingRequest\x1a\x1d.google.longrunning.Operation\"\xb6\x02\xca\x41\"\n\rPolicyBinding\x12\x11OperationMetadata\xda\x41\'parent,policy_binding,policy_binding_id\x82\xd3\xe4\x93\x02\xe0\x01\"6/v3beta/{parent=projects/*/locations/*}/policyBindings:\x0epolicy_bindingZG\"5/v3beta/{parent=folders/*/locations/*}/policyBindings:\x0epolicy_bindingZM\";/v3beta/{parent=organizations/*/locations/*}/policyBindings:\x0epolicy_binding\x12\xa1\x02\n\x10GetPolicyBinding\x12*.google.iam.v3beta.GetPolicyBindingRequest\x1a .google.iam.v3beta.PolicyBinding\"\xbe\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xb0\x01\x12\x36/v3beta/{name=projects/*/locations/*/policyBindings/*}Z7\x12\x35/v3beta/{name=folders/*/locations/*/policyBindings/*}Z=\x12;/v3beta/{name=organizations/*/locations/*/policyBindings/*}\x12\xbc\x03\n\x13UpdatePolicyBinding\x12-.google.iam.v3beta.UpdatePolicyBindingRequest\x1a\x1d.google.longrunning.Operation\"\xd6\x02\xca\x41\"\n\rPolicyBinding\x12\x11OperationMetadata\xda\x41\x1apolicy_binding,update_mask\x82\xd3\xe4\x93\x02\x8d\x02\x32\x45/v3beta/{policy_binding.name=projects/*/locations/*/policyBindings/*}:\x0epolicy_bindingZV2D/v3beta/{policy_binding.name=folders/*/locations/*/policyBindings/*}:\x0epolicy_bindingZ\\2J/v3beta/{policy_binding.name=organizations/*/locations/*/policyBindings/*}:\x0epolicy_binding\x12\xd1\x02\n\x13\x44\x65letePolicyBinding\x12-.google.iam.v3beta.DeletePolicyBindingRequest\x1a\x1d.google.longrunning.Operation\"\xeb\x01\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\xb0\x01*6/v3beta/{name=projects/*/locations/*/policyBindings/*}Z7*5/v3beta/{name=folders/*/locations/*/policyBindings/*}Z=*;/v3beta/{name=organizations/*/locations/*/policyBindings/*}\x12\xb4\x02\n\x12ListPolicyBindings\x12,.google.iam.v3beta.ListPolicyBindingsRequest\x1a-.google.iam.v3beta.ListPolicyBindingsResponse\"\xc0\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xb0\x01\x12\x36/v3beta/{parent=projects/*/locations/*}/policyBindingsZ7\x12\x35/v3beta/{parent=folders/*/locations/*}/policyBindingsZ=\x12;/v3beta/{parent=organizations/*/locations/*}/policyBindings\x12\xa4\x03\n\x1aSearchTargetPolicyBindings\x12\x34.google.iam.v3beta.SearchTargetPolicyBindingsRequest\x1a\x35.google.iam.v3beta.SearchTargetPolicyBindingsResponse\"\x98\x02\xda\x41\rparent,target\x82\xd3\xe4\x93\x02\x81\x02\x12Q/v3beta/{parent=projects/*/locations/*}/policyBindings:searchTargetPolicyBindingsZR\x12P/v3beta/{parent=folders/*/locations/*}/policyBindings:searchTargetPolicyBindingsZX\x12V/v3beta/{parent=organizations/*/locations/*}/policyBindings:searchTargetPolicyBindings\x1a\x46\xca\x41\x12iam.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc4\x02\n\x15\x63om.google.iam.v3betaB\x1aPolicyBindingsServiceProtoP\x01Z-cloud.google.com/go/iam/apiv3beta/iampb;iampb\xaa\x02\x17Google.Cloud.Iam.V3Beta\xca\x02\x17Google\\Cloud\\Iam\\V3beta\xea\x41\\\n\'iam.googleapis.com/OrganizationLocation\x12\x31organizations/{organization}/locations/{location}\xea\x41J\n!iam.googleapis.com/FolderLocation\x12%folders/{folder}/locations/{location}b\x06proto3" +descriptor_data = "\n/google/iam/v3beta/policy_bindings_service.proto\x12\x11google.iam.v3beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/iam/v3beta/operation_metadata.proto\x1a\x30google/iam/v3beta/policy_binding_resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xd1\x01\n\x1a\x43reatePolicyBindingRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 iam.googleapis.com/PolicyBinding\x12\x1e\n\x11policy_binding_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12=\n\x0epolicy_binding\x18\x03 \x01(\x0b\x32 .google.iam.v3beta.PolicyBindingB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"Q\n\x17GetPolicyBindingRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n iam.googleapis.com/PolicyBinding\"\xad\x01\n\x1aUpdatePolicyBindingRequest\x12=\n\x0epolicy_binding\x18\x01 \x01(\x0b\x32 .google.iam.v3beta.PolicyBindingB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x83\x01\n\x1a\x44\x65letePolicyBindingRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n iam.googleapis.com/PolicyBinding\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x9b\x01\n\x19ListPolicyBindingsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 iam.googleapis.com/PolicyBinding\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\"u\n\x1aListPolicyBindingsResponse\x12\x39\n\x0fpolicy_bindings\x18\x01 \x03(\x0b\x32 .google.iam.v3beta.PolicyBinding\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb8\x01\n!SearchTargetPolicyBindingsRequest\x12\x13\n\x06target\x18\x01 \x01(\tB\x03\xe0\x41\x02\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\x38\n\x06parent\x18\x05 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 iam.googleapis.com/PolicyBinding\x12\x13\n\x06\x66ilter\x18\x06 \x01(\tB\x03\xe0\x41\x01\"}\n\"SearchTargetPolicyBindingsResponse\x12\x39\n\x0fpolicy_bindings\x18\x01 \x03(\x0b\x32 .google.iam.v3beta.PolicyBinding\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x32\x8c\x12\n\x0ePolicyBindings\x12\x9c\x03\n\x13\x43reatePolicyBinding\x12-.google.iam.v3beta.CreatePolicyBindingRequest\x1a\x1d.google.longrunning.Operation\"\xb6\x02\xca\x41\"\n\rPolicyBinding\x12\x11OperationMetadata\xda\x41\'parent,policy_binding,policy_binding_id\x82\xd3\xe4\x93\x02\xe0\x01\"6/v3beta/{parent=projects/*/locations/*}/policyBindings:\x0epolicy_bindingZG\"5/v3beta/{parent=folders/*/locations/*}/policyBindings:\x0epolicy_bindingZM\";/v3beta/{parent=organizations/*/locations/*}/policyBindings:\x0epolicy_binding\x12\xa1\x02\n\x10GetPolicyBinding\x12*.google.iam.v3beta.GetPolicyBindingRequest\x1a .google.iam.v3beta.PolicyBinding\"\xbe\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xb0\x01\x12\x36/v3beta/{name=projects/*/locations/*/policyBindings/*}Z7\x12\x35/v3beta/{name=folders/*/locations/*/policyBindings/*}Z=\x12;/v3beta/{name=organizations/*/locations/*/policyBindings/*}\x12\xbc\x03\n\x13UpdatePolicyBinding\x12-.google.iam.v3beta.UpdatePolicyBindingRequest\x1a\x1d.google.longrunning.Operation\"\xd6\x02\xca\x41\"\n\rPolicyBinding\x12\x11OperationMetadata\xda\x41\x1apolicy_binding,update_mask\x82\xd3\xe4\x93\x02\x8d\x02\x32\x45/v3beta/{policy_binding.name=projects/*/locations/*/policyBindings/*}:\x0epolicy_bindingZV2D/v3beta/{policy_binding.name=folders/*/locations/*/policyBindings/*}:\x0epolicy_bindingZ\\2J/v3beta/{policy_binding.name=organizations/*/locations/*/policyBindings/*}:\x0epolicy_binding\x12\xd1\x02\n\x13\x44\x65letePolicyBinding\x12-.google.iam.v3beta.DeletePolicyBindingRequest\x1a\x1d.google.longrunning.Operation\"\xeb\x01\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\xb0\x01*6/v3beta/{name=projects/*/locations/*/policyBindings/*}Z7*5/v3beta/{name=folders/*/locations/*/policyBindings/*}Z=*;/v3beta/{name=organizations/*/locations/*/policyBindings/*}\x12\xb4\x02\n\x12ListPolicyBindings\x12,.google.iam.v3beta.ListPolicyBindingsRequest\x1a-.google.iam.v3beta.ListPolicyBindingsResponse\"\xc0\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xb0\x01\x12\x36/v3beta/{parent=projects/*/locations/*}/policyBindingsZ7\x12\x35/v3beta/{parent=folders/*/locations/*}/policyBindingsZ=\x12;/v3beta/{parent=organizations/*/locations/*}/policyBindings\x12\xa4\x03\n\x1aSearchTargetPolicyBindings\x12\x34.google.iam.v3beta.SearchTargetPolicyBindingsRequest\x1a\x35.google.iam.v3beta.SearchTargetPolicyBindingsResponse\"\x98\x02\xda\x41\rparent,target\x82\xd3\xe4\x93\x02\x81\x02\x12Q/v3beta/{parent=projects/*/locations/*}/policyBindings:searchTargetPolicyBindingsZR\x12P/v3beta/{parent=folders/*/locations/*}/policyBindings:searchTargetPolicyBindingsZX\x12V/v3beta/{parent=organizations/*/locations/*}/policyBindings:searchTargetPolicyBindings\x1a\x46\xca\x41\x12iam.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc4\x02\n\x15\x63om.google.iam.v3betaB\x1aPolicyBindingsServiceProtoP\x01Z-cloud.google.com/go/iam/apiv3beta/iampb;iampb\xaa\x02\x17Google.Cloud.Iam.V3Beta\xca\x02\x17Google\\Cloud\\Iam\\V3beta\xea\x41\\\n\'iam.googleapis.com/OrganizationLocation\x12\x31organizations/{organization}/locations/{location}\xea\x41J\n!iam.googleapis.com/FolderLocation\x12%folders/{folder}/locations/{location}b\x06proto3" pool = ::Google::Protobuf::DescriptorPool.generated_pool pool.add_serialized_file(descriptor_data) diff --git a/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_services_pb.rb b/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_services_pb.rb index 4529103991f0..6756bfa36dc0 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_services_pb.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_services_pb.rb @@ -35,19 +35,17 @@ class Service # Creates a policy binding and returns a long-running operation. # Callers will need the IAM permissions on both the policy and target. - # Once the binding is created, the policy is applied to the target. + # After the binding is created, the policy is applied to the target. rpc :CreatePolicyBinding, ::Google::Iam::V3beta::CreatePolicyBindingRequest, ::Google::Longrunning::Operation # Gets a policy binding. rpc :GetPolicyBinding, ::Google::Iam::V3beta::GetPolicyBindingRequest, ::Google::Iam::V3beta::PolicyBinding # Updates a policy binding and returns a long-running operation. # Callers will need the IAM permissions on the policy and target in the - # binding to update, and the IAM permission to remove the existing policy - # from the binding. Target is immutable and cannot be updated. Once the - # binding is updated, the new policy is applied to the target. + # binding to update. Target and policy are immutable and cannot be updated. rpc :UpdatePolicyBinding, ::Google::Iam::V3beta::UpdatePolicyBindingRequest, ::Google::Longrunning::Operation # Deletes a policy binding and returns a long-running operation. # Callers will need the IAM permissions on both the policy and target. - # Once the binding is deleted, the policy no longer applies to the target. + # After the binding is deleted, the policy no longer applies to the target. rpc :DeletePolicyBinding, ::Google::Iam::V3beta::DeletePolicyBindingRequest, ::Google::Longrunning::Operation # Lists policy bindings. rpc :ListPolicyBindings, ::Google::Iam::V3beta::ListPolicyBindingsRequest, ::Google::Iam::V3beta::ListPolicyBindingsResponse diff --git a/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies.rb b/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies.rb index abbc7442e148..68b668f8d20e 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies.rb @@ -20,7 +20,7 @@ require "gapic/config" require "gapic/config/method" -require "google/iam/v3beta/version" +require "google/cloud/iam/v3beta/version" require "google/iam/v3beta/principal_access_boundary_policies/credentials" require "google/iam/v3beta/principal_access_boundary_policies/paths" diff --git a/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/client.rb b/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/client.rb index edf536817c95..8436fc95c2c1 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/client.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/client.rb @@ -317,7 +317,7 @@ def create_principal_access_boundary_policy request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -407,7 +407,7 @@ def get_principal_access_boundary_policy request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -507,7 +507,7 @@ def update_principal_access_boundary_policy request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -613,7 +613,7 @@ def delete_principal_access_boundary_policy request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -723,7 +723,7 @@ def list_principal_access_boundary_policies request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -831,7 +831,7 @@ def search_principal_access_boundary_policy_bindings request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id diff --git a/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/operations.rb b/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/operations.rb index 1b086e408dea..453387aae9fe 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/operations.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/operations.rb @@ -199,7 +199,7 @@ def list_operations request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -296,7 +296,7 @@ def get_operation request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -386,7 +386,7 @@ def delete_operation request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -481,7 +481,7 @@ def cancel_operation request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id @@ -585,7 +585,7 @@ def wait_operation request, options = nil # 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::Iam::V3beta::VERSION + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id diff --git a/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest.rb b/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest.rb index bc4a47b973f1..70f0fad5038e 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest.rb @@ -20,7 +20,7 @@ require "gapic/config" require "gapic/config/method" -require "google/iam/v3beta/version" +require "google/cloud/iam/v3beta/version" require "google/iam/v3beta/principal_access_boundary_policies/credentials" require "google/iam/v3beta/principal_access_boundary_policies/paths" diff --git a/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/client.rb b/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/client.rb index 50759dad3f44..c00cea6a266a 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/client.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/client.rb @@ -309,7 +309,7 @@ def create_principal_access_boundary_policy request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? @@ -392,7 +392,7 @@ def get_principal_access_boundary_policy request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? @@ -485,7 +485,7 @@ def update_principal_access_boundary_policy request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? @@ -584,7 +584,7 @@ def delete_principal_access_boundary_policy request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? @@ -687,7 +687,7 @@ def list_principal_access_boundary_policies request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? @@ -788,7 +788,7 @@ def search_principal_access_boundary_policy_bindings request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? diff --git a/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/operations.rb b/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/operations.rb index 8b267f7f6a9f..f790a52a68e6 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/operations.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/operations.rb @@ -189,7 +189,7 @@ def list_operations request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? @@ -278,7 +278,7 @@ def get_operation request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? @@ -361,7 +361,7 @@ def delete_operation request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? @@ -449,7 +449,7 @@ def cancel_operation request, options = nil # 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::Iam::V3beta::VERSION, + gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, transports_version_send: [:rest] call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? diff --git a/google-iam-v3beta/lib/google/iam/v3beta/rest.rb b/google-iam-v3beta/lib/google/iam/v3beta/rest.rb index 4492108e6037..2382e231a62c 100644 --- a/google-iam-v3beta/lib/google/iam/v3beta/rest.rb +++ b/google-iam-v3beta/lib/google/iam/v3beta/rest.rb @@ -16,9 +16,10 @@ # Auto-generated by gapic-generator-ruby. DO NOT EDIT! +require "google/iam/v3beta/access_policies/rest" require "google/iam/v3beta/policy_bindings/rest" require "google/iam/v3beta/principal_access_boundary_policies/rest" -require "google/iam/v3beta/version" +require "google/cloud/iam/v3beta/version" module Google module Iam @@ -28,7 +29,7 @@ module Iam # @example # # require "google/iam/v3beta/rest" - # client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new + # client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new # module V3beta end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/access_policies_service.rb b/google-iam-v3beta/proto_docs/google/iam/v3beta/access_policies_service.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/access_policies_service.rb rename to google-iam-v3beta/proto_docs/google/iam/v3beta/access_policies_service.rb diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/access_policy_resources.rb b/google-iam-v3beta/proto_docs/google/iam/v3beta/access_policy_resources.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/access_policy_resources.rb rename to google-iam-v3beta/proto_docs/google/iam/v3beta/access_policy_resources.rb diff --git a/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_binding_resources.rb b/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_binding_resources.rb index 5eefbd2f1aab..2d9c21ec07d3 100644 --- a/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_binding_resources.rb +++ b/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_binding_resources.rb @@ -53,8 +53,8 @@ module V3beta # size limitations # @!attribute [rw] target # @return [::Google::Iam::V3beta::PolicyBinding::Target] - # Required. Immutable. Target is the full resource name of the resource to - # which the policy will be bound. Immutable once set. + # Required. Immutable. The full resource name of the resource to which the + # policy will be bound. Immutable once set. # @!attribute [rw] policy_kind # @return [::Google::Iam::V3beta::PolicyBinding::PolicyKind] # Immutable. The kind of the policy to attach in this binding. This field @@ -100,13 +100,14 @@ module V3beta # - `principal.type != ` # - `principal.type in []` # - # Supported principal types are Workspace, Workforce Pool, Workload Pool and - # Service Account. Allowed string must be one of: + # Supported principal types are workspace, workforce pool, workload pool, + # service account, and Agent Identity. Allowed string must be one of: # - # - iam.googleapis.com/WorkspaceIdentity - # - iam.googleapis.com/WorkforcePoolIdentity - # - iam.googleapis.com/WorkloadPoolIdentity - # - iam.googleapis.com/ServiceAccount + # - `iam.googleapis.com/WorkspaceIdentity` + # - `iam.googleapis.com/WorkforcePoolIdentity` + # - `iam.googleapis.com/WorkloadPoolIdentity` + # - `iam.googleapis.com/ServiceAccount` + # - `iam.googleapis.com/AgentPoolIdentity` (available in Preview) # @!attribute [r] create_time # @return [::Google::Protobuf::Timestamp] # Output only. The time when the policy binding was created. @@ -117,32 +118,50 @@ class PolicyBinding include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods - # Target is the full resource name of the resource to which the policy will + # The full resource name of the resource to which the policy will # be bound. Immutable once set. # @!attribute [rw] principal_set # @return [::String] - # Immutable. Full Resource Name used for principal access boundary policy - # bindings. The principal set must be directly parented by the policy - # binding's parent or same as the parent if the target is a - # project/folder/organization. + # Immutable. The full resource name that's used for principal access + # boundary policy bindings. The principal set must be directly parented + # by the policy binding's parent or same as the parent if the target is a + # project, folder, or organization. # # Examples: - # * For binding's parented by an organization: - # * Organization: - # `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID` - # * Workforce Identity: - # `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID` - # * Workspace Identity: - # `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID` - # * For binding's parented by a folder: - # * Folder: - # `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID` - # * For binding's parented by a project: - # * Project: + # + # * For bindings parented by an organization: + # * Organization: + # `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID` + # * Workforce Identity: + # `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID` + # * Workspace Identity: + # `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID` + # * For bindings parented by a folder: + # * Folder: + # `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID` + # * For bindings parented by a project: + # * Project: + # * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER` + # * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID` + # * Workload Identity Pool: + # `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID` + # + # Note: The following fields are mutually exclusive: `principal_set`, `resource`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] resource + # @return [::String] + # Immutable. The full resource name that's used for access policy + # bindings. + # + # Examples: + # + # * Organization: + # `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID` + # * Folder: `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID` + # * Project: # * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER` # * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID` - # * Workload Identity Pool: - # `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID` + # + # Note: The following fields are mutually exclusive: `resource`, `principal_set`. If a field in that set is populated, all other fields in the set will automatically be cleared. class Target include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -157,13 +176,16 @@ class AnnotationsEntry extend ::Google::Protobuf::MessageExts::ClassMethods end - # Different policy kinds supported in this binding. + # The different policy kinds supported in this binding. module PolicyKind # Unspecified policy kind; Not a valid state POLICY_KIND_UNSPECIFIED = 0 # Principal access boundary policy kind PRINCIPAL_ACCESS_BOUNDARY = 1 + + # Access policy kind. + ACCESS = 2 end end end diff --git a/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_bindings_service.rb b/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_bindings_service.rb index 50db4575c321..6032552361e9 100644 --- a/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_bindings_service.rb +++ b/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_bindings_service.rb @@ -129,8 +129,7 @@ class DeletePolicyBindingRequest # Optional. The maximum number of policy bindings to return. The service may # return fewer than this value. # - # If unspecified, at most 50 policy bindings will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. + # The default value is 50. The maximum value is 1000. # @!attribute [rw] page_token # @return [::String] # Optional. A page token, received from a previous `ListPolicyBindings` call. @@ -141,7 +140,8 @@ class DeletePolicyBindingRequest # @!attribute [rw] filter # @return [::String] # Optional. An expression for filtering the results of the request. Filter - # rules are case insensitive. Some eligible fields for filtering are: + # rules are case insensitive. Some eligible fields for filtering are the + # following: # # + `target` # + `policy` @@ -187,8 +187,7 @@ class ListPolicyBindingsResponse # Optional. The maximum number of policy bindings to return. The service may # return fewer than this value. # - # If unspecified, at most 50 policy bindings will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. + # The default value is 50. The maximum value is 1000. # @!attribute [rw] page_token # @return [::String] # Optional. A page token, received from a previous @@ -210,6 +209,18 @@ class ListPolicyBindingsResponse # * `projects/{project_number}/locations/{location}` # * `folders/{folder_id}/locations/{location}` # * `organizations/{organization_id}/locations/{location}` + # @!attribute [rw] filter + # @return [::String] + # Optional. Filtering currently only supports the kind of policies to return, + # and must be in the format "policy_kind=\\{policy_kind}". + # + # If String is empty, bindings bound to all kinds of policies would be + # returned. + # + # The only supported values are the following: + # + # * "policy_kind=PRINCIPAL_ACCESS_BOUNDARY", + # * "policy_kind=ACCESS" class SearchTargetPolicyBindingsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-iam-v3beta/snippets/Gemfile b/google-iam-v3beta/snippets/Gemfile index 5202fc1b4ae1..77a6b0cc1e2c 100644 --- a/google-iam-v3beta/snippets/Gemfile +++ b/google-iam-v3beta/snippets/Gemfile @@ -19,9 +19,9 @@ source "https://rubygems.org" if ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - gem "google-iam-v3beta", path: "../" + gem "google-cloud-iam-v3beta", path: "../" else - gem "google-iam-v3beta" + gem "google-cloud-iam-v3beta" end group :test do diff --git a/owl-bot-staging/google-iam-v3beta/snippets/access_policies/create_access_policy.rb b/google-iam-v3beta/snippets/access_policies/create_access_policy.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/snippets/access_policies/create_access_policy.rb rename to google-iam-v3beta/snippets/access_policies/create_access_policy.rb diff --git a/owl-bot-staging/google-iam-v3beta/snippets/access_policies/delete_access_policy.rb b/google-iam-v3beta/snippets/access_policies/delete_access_policy.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/snippets/access_policies/delete_access_policy.rb rename to google-iam-v3beta/snippets/access_policies/delete_access_policy.rb diff --git a/owl-bot-staging/google-iam-v3beta/snippets/access_policies/get_access_policy.rb b/google-iam-v3beta/snippets/access_policies/get_access_policy.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/snippets/access_policies/get_access_policy.rb rename to google-iam-v3beta/snippets/access_policies/get_access_policy.rb diff --git a/owl-bot-staging/google-iam-v3beta/snippets/access_policies/list_access_policies.rb b/google-iam-v3beta/snippets/access_policies/list_access_policies.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/snippets/access_policies/list_access_policies.rb rename to google-iam-v3beta/snippets/access_policies/list_access_policies.rb diff --git a/owl-bot-staging/google-iam-v3beta/snippets/access_policies/search_access_policy_bindings.rb b/google-iam-v3beta/snippets/access_policies/search_access_policy_bindings.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/snippets/access_policies/search_access_policy_bindings.rb rename to google-iam-v3beta/snippets/access_policies/search_access_policy_bindings.rb diff --git a/owl-bot-staging/google-iam-v3beta/snippets/access_policies/update_access_policy.rb b/google-iam-v3beta/snippets/access_policies/update_access_policy.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/snippets/access_policies/update_access_policy.rb rename to google-iam-v3beta/snippets/access_policies/update_access_policy.rb diff --git a/google-iam-v3beta/snippets/snippet_metadata_google.iam.v3beta.json b/google-iam-v3beta/snippets/snippet_metadata_google.iam.v3beta.json index 859765a02a09..858601e636ad 100644 --- a/google-iam-v3beta/snippets/snippet_metadata_google.iam.v3beta.json +++ b/google-iam-v3beta/snippets/snippet_metadata_google.iam.v3beta.json @@ -1,6 +1,6 @@ { "client_library": { - "name": "google-iam-v3beta", + "name": "google-cloud-iam-v3beta", "version": "0.4.1", "language": "RUBY", "apis": [ @@ -11,6 +11,246 @@ ] }, "snippets": [ + { + "region_tag": "iam_v3beta_generated_AccessPolicies_CreateAccessPolicy_sync", + "title": "Snippet for the create_access_policy call in the AccessPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#create_access_policy.", + "file": "access_policies/create_access_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_access_policy", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#create_access_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::CreateAccessPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AccessPolicies::Client", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" + }, + "method": { + "short_name": "CreateAccessPolicy", + "full_name": "google.iam.v3beta.AccessPolicies.CreateAccessPolicy", + "service": { + "short_name": "AccessPolicies", + "full_name": "google.iam.v3beta.AccessPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_AccessPolicies_GetAccessPolicy_sync", + "title": "Snippet for the get_access_policy call in the AccessPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#get_access_policy.", + "file": "access_policies/get_access_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_access_policy", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#get_access_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::GetAccessPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V3beta::AccessPolicy", + "client": { + "short_name": "AccessPolicies::Client", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" + }, + "method": { + "short_name": "GetAccessPolicy", + "full_name": "google.iam.v3beta.AccessPolicies.GetAccessPolicy", + "service": { + "short_name": "AccessPolicies", + "full_name": "google.iam.v3beta.AccessPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_AccessPolicies_UpdateAccessPolicy_sync", + "title": "Snippet for the update_access_policy call in the AccessPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#update_access_policy.", + "file": "access_policies/update_access_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_access_policy", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#update_access_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::UpdateAccessPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AccessPolicies::Client", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" + }, + "method": { + "short_name": "UpdateAccessPolicy", + "full_name": "google.iam.v3beta.AccessPolicies.UpdateAccessPolicy", + "service": { + "short_name": "AccessPolicies", + "full_name": "google.iam.v3beta.AccessPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_AccessPolicies_DeleteAccessPolicy_sync", + "title": "Snippet for the delete_access_policy call in the AccessPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#delete_access_policy.", + "file": "access_policies/delete_access_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_access_policy", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#delete_access_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::DeleteAccessPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AccessPolicies::Client", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" + }, + "method": { + "short_name": "DeleteAccessPolicy", + "full_name": "google.iam.v3beta.AccessPolicies.DeleteAccessPolicy", + "service": { + "short_name": "AccessPolicies", + "full_name": "google.iam.v3beta.AccessPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_AccessPolicies_ListAccessPolicies_sync", + "title": "Snippet for the list_access_policies call in the AccessPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#list_access_policies.", + "file": "access_policies/list_access_policies.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_access_policies", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#list_access_policies", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::ListAccessPoliciesRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V3beta::ListAccessPoliciesResponse", + "client": { + "short_name": "AccessPolicies::Client", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" + }, + "method": { + "short_name": "ListAccessPolicies", + "full_name": "google.iam.v3beta.AccessPolicies.ListAccessPolicies", + "service": { + "short_name": "AccessPolicies", + "full_name": "google.iam.v3beta.AccessPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v3beta_generated_AccessPolicies_SearchAccessPolicyBindings_sync", + "title": "Snippet for the search_access_policy_bindings call in the AccessPolicies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#search_access_policy_bindings.", + "file": "access_policies/search_access_policy_bindings.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_access_policy_bindings", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#search_access_policy_bindings", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V3beta::SearchAccessPolicyBindingsResponse", + "client": { + "short_name": "AccessPolicies::Client", + "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" + }, + "method": { + "short_name": "SearchAccessPolicyBindings", + "full_name": "google.iam.v3beta.AccessPolicies.SearchAccessPolicyBindings", + "service": { + "short_name": "AccessPolicies", + "full_name": "google.iam.v3beta.AccessPolicies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, { "region_tag": "iam_v3beta_generated_PolicyBindings_CreatePolicyBinding_sync", "title": "Snippet for the create_policy_binding call in the PolicyBindings service", diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_operations_test.rb b/google-iam-v3beta/test/google/iam/v3beta/access_policies_operations_test.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_operations_test.rb rename to google-iam-v3beta/test/google/iam/v3beta/access_policies_operations_test.rb diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_paths_test.rb b/google-iam-v3beta/test/google/iam/v3beta/access_policies_paths_test.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_paths_test.rb rename to google-iam-v3beta/test/google/iam/v3beta/access_policies_paths_test.rb diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_rest_test.rb b/google-iam-v3beta/test/google/iam/v3beta/access_policies_rest_test.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_rest_test.rb rename to google-iam-v3beta/test/google/iam/v3beta/access_policies_rest_test.rb diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_test.rb b/google-iam-v3beta/test/google/iam/v3beta/access_policies_test.rb similarity index 100% rename from owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/access_policies_test.rb rename to google-iam-v3beta/test/google/iam/v3beta/access_policies_test.rb diff --git a/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_rest_test.rb b/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_rest_test.rb index a6213bfeb014..a305f0ee187f 100644 --- a/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_rest_test.rb +++ b/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_rest_test.rb @@ -370,6 +370,7 @@ def test_search_target_policy_bindings page_size = 42 page_token = "hello world" parent = "hello world" + filter = "hello world" search_target_policy_bindings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| assert options.metadata.key? :"x-goog-api-client" @@ -385,27 +386,27 @@ def test_search_target_policy_bindings end # Use hash object - client.search_target_policy_bindings({ target: target, page_size: page_size, page_token: page_token, parent: parent }) do |_result, response| + client.search_target_policy_bindings({ target: target, page_size: page_size, page_token: page_token, parent: parent, filter: filter }) do |_result, response| assert_equal http_response, response.underlying_op end # Use named arguments - client.search_target_policy_bindings target: target, page_size: page_size, page_token: page_token, parent: parent do |_result, response| + client.search_target_policy_bindings target: target, page_size: page_size, page_token: page_token, parent: parent, filter: filter do |_result, response| assert_equal http_response, response.underlying_op end # Use protobuf object - client.search_target_policy_bindings ::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new(target: target, page_size: page_size, page_token: page_token, parent: parent) do |_result, response| + client.search_target_policy_bindings ::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new(target: target, page_size: page_size, page_token: page_token, parent: parent, filter: filter) do |_result, response| assert_equal http_response, response.underlying_op end # Use hash object with options - client.search_target_policy_bindings({ target: target, page_size: page_size, page_token: page_token, parent: parent }, call_options) do |_result, response| + client.search_target_policy_bindings({ target: target, page_size: page_size, page_token: page_token, parent: parent, filter: filter }, call_options) do |_result, response| assert_equal http_response, response.underlying_op end # Use protobuf object with options - client.search_target_policy_bindings(::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new(target: target, page_size: page_size, page_token: page_token, parent: parent), call_options) do |_result, response| + client.search_target_policy_bindings(::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new(target: target, page_size: page_size, page_token: page_token, parent: parent, filter: filter), call_options) do |_result, response| assert_equal http_response, response.underlying_op end diff --git a/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_test.rb b/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_test.rb index 2619d5f5c1c4..9d3e0530a2f9 100644 --- a/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_test.rb +++ b/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_test.rb @@ -405,6 +405,7 @@ def test_search_target_policy_bindings page_size = 42 page_token = "hello world" parent = "hello world" + filter = "hello world" search_target_policy_bindings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| assert_equal :search_target_policy_bindings, name @@ -413,6 +414,7 @@ def test_search_target_policy_bindings assert_equal 42, request["page_size"] assert_equal "hello world", request["page_token"] assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] refute_nil options end @@ -423,35 +425,35 @@ def test_search_target_policy_bindings end # Use hash object - client.search_target_policy_bindings({ target: target, page_size: page_size, page_token: page_token, parent: parent }) do |response, operation| + client.search_target_policy_bindings({ target: target, page_size: page_size, page_token: page_token, parent: parent, 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 - client.search_target_policy_bindings target: target, page_size: page_size, page_token: page_token, parent: parent do |response, operation| + client.search_target_policy_bindings target: target, page_size: page_size, page_token: page_token, parent: parent, 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 - client.search_target_policy_bindings ::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new(target: target, page_size: page_size, page_token: page_token, parent: parent) do |response, operation| + client.search_target_policy_bindings ::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new(target: target, page_size: page_size, page_token: page_token, parent: parent, 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 - client.search_target_policy_bindings({ target: target, page_size: page_size, page_token: page_token, parent: parent }, grpc_options) do |response, operation| + client.search_target_policy_bindings({ target: target, page_size: page_size, page_token: page_token, parent: parent, 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 - client.search_target_policy_bindings(::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new(target: target, page_size: page_size, page_token: page_token, parent: parent), grpc_options) do |response, operation| + client.search_target_policy_bindings(::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new(target: target, page_size: page_size, page_token: page_token, parent: parent, filter: filter), grpc_options) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation diff --git a/owl-bot-staging/google-iam-v3beta/.gitignore b/owl-bot-staging/google-iam-v3beta/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-iam-v3beta/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -# Ignore bundler lockfiles -Gemfile.lock -gems.locked - -# Ignore documentation output -doc/* -.yardoc/* - -# Ignore test output -coverage/* - -# Ignore build artifacts -pkg/* - -# Ignore files commonly present in certain dev environments -.vagrant -.DS_STORE -.idea -*.iml - -# Ignore synth output -__pycache__ diff --git a/owl-bot-staging/google-iam-v3beta/.repo-metadata.json b/owl-bot-staging/google-iam-v3beta/.repo-metadata.json deleted file mode 100644 index b550bb371a13..000000000000 --- a/owl-bot-staging/google-iam-v3beta/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "iam.googleapis.com", - "api_shortname": "iam", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-iam-v3beta/latest", - "distribution_name": "google-cloud-iam-v3beta", - "is_cloud": true, - "language": "ruby", - "name": "iam", - "name_pretty": "Identity and Access Management (IAM) V3BETA API", - "product_documentation": "https://cloud.google.com/iam/docs/overview", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API. Note that google-cloud-iam-v3beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-iam instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/iam/docs/overview", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-iam-v3beta/.rubocop.yml b/owl-bot-staging/google-iam-v3beta/.rubocop.yml deleted file mode 100644 index efbd005346b3..000000000000 --- a/owl-bot-staging/google-iam-v3beta/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-iam-v3beta.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-iam-v3beta.rb" diff --git a/owl-bot-staging/google-iam-v3beta/.toys.rb b/owl-bot-staging/google-iam-v3beta/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-iam-v3beta/.toys.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -toys_version! ">= 0.15.3" - -if ENV["RUBY_COMMON_TOOLS"] - common_tools_dir = File.expand_path ENV["RUBY_COMMON_TOOLS"] - load File.join(common_tools_dir, "toys", "gapic") -else - load_git remote: "https://github.com/googleapis/ruby-common-tools.git", - path: "toys/gapic", - update: true -end diff --git a/owl-bot-staging/google-iam-v3beta/.yardopts b/owl-bot-staging/google-iam-v3beta/.yardopts deleted file mode 100644 index 10df2b7003ed..000000000000 --- a/owl-bot-staging/google-iam-v3beta/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Identity and Access Management (IAM) V3BETA 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-iam-v3beta/AUTHENTICATION.md b/owl-bot-staging/google-iam-v3beta/AUTHENTICATION.md deleted file mode 100644 index ff7654b6751d..000000000000 --- a/owl-bot-staging/google-iam-v3beta/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-iam-v3beta 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-iam-v3beta 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/iam/v3beta" - -client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/iam/v3beta" - -::Google::Iam::V3beta::AccessPolicies::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Iam::V3beta::AccessPolicies::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-iam-v3beta -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/iam/v3beta" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Iam::V3beta::AccessPolicies::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-iam-v3beta/CHANGELOG.md b/owl-bot-staging/google-iam-v3beta/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-iam-v3beta/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-iam-v3beta/Gemfile b/owl-bot-staging/google-iam-v3beta/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/LICENSE.md b/owl-bot-staging/google-iam-v3beta/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/README.md b/owl-bot-staging/google-iam-v3beta/README.md deleted file mode 100644 index f708122c6c3a..000000000000 --- a/owl-bot-staging/google-iam-v3beta/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Identity and Access Management (IAM) V3BETA API - -Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API. - -Manages identity and access control for Google Cloud resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Enabling this API also enables the IAM Service Account Credentials API (iamcredentials.googleapis.com). However, disabling this API doesn't disable the IAM Service Account Credentials API. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Identity and Access Management (IAM) V3BETA API. Most users should consider using -the main client gem, -[google-cloud-iam](https://rubygems.org/gems/google-cloud-iam). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-iam-v3beta -``` - -## 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/iam.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/iam/v3beta" - -client = ::Google::Iam::V3beta::AccessPolicies::Client.new -request = ::Google::Iam::V3beta::CreateAccessPolicyRequest.new # (request fields as keyword arguments...) -response = client.create_access_policy request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-iam-v3beta/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/iam/docs/overview) -for general usage information. - -## Debug Logging - -This library comes with opt-in Debug Logging that can help you troubleshoot -your application's integration with the API. When logging is activated, key -events such as requests and responses, along with data payloads and metadata -such as headers and client configuration, are logged to the standard error -stream. - -**WARNING:** Client Library Debug Logging includes your data payloads in -plaintext, which could include sensitive data such as PII for yourself or your -customers, private keys, or other security data that could be compromising if -leaked. Always practice good data hygiene with your application logs, and follow -the principle of least access. Google also recommends that Client Library Debug -Logging be enabled only temporarily during active debugging, and not used -permanently in production. - -To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS` -to the value `all`. Alternatively, you can set the value to a comma-delimited -list of client library gem names. This will select the default logging behavior, -which writes logs to the standard error stream. On a local workstation, this may -result in logs appearing on the console. When running on a Google Cloud hosting -service such as [Google Cloud Run](https://cloud.google.com/run), this generally -results in logs appearing alongside your application logs in the -[Google Cloud Logging](https://cloud.google.com/logging/) service. - -You can customize logging by modifying the `logger` configuration when -constructing a client object. For example: - -```ruby -require "google/iam/v3beta" -require "logger" - -client = ::Google::Iam::V3beta::AccessPolicies::Client.new do |config| - config.logger = Logger.new "my-app.log" -end -``` - -## Google Cloud Samples - -To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples). - -## Supported Ruby Versions - -This library is supported on Ruby 3.0+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Which client should I use? - -Most modern Ruby client libraries for Google APIs come in two flavors: the main -client library with a name such as `google-cloud-iam`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-iam-v3beta`. -_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-iam`. -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-iam-v3beta`. - -### 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-iam-v3beta/Rakefile b/owl-bot-staging/google-iam-v3beta/Rakefile deleted file mode 100644 index 4784cc7f73f9..000000000000 --- a/owl-bot-staging/google-iam-v3beta/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-iam-v3beta acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || - ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/iam/v3beta/access_policies/credentials" - ::Google::Iam::V3beta::AccessPolicies::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_KEYFILE_JSON"] = keyfile - - Rake::Task["acceptance:run"].invoke -end - -namespace :acceptance do - task :run do - if File.directory? "acceptance" - Rake::Task[:smoke_test].invoke - else - puts "The google-cloud-iam-v3beta 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-iam-v3beta 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-iam-v3beta 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-iam-v3beta gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-iam-v3beta" - header "google-cloud-iam-v3beta rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-iam-v3beta yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-iam-v3beta 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-iam-v3beta 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-iam-v3beta 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-iam-v3beta/gapic_metadata.json b/owl-bot-staging/google-iam-v3beta/gapic_metadata.json deleted file mode 100644 index 13391b62f322..000000000000 --- a/owl-bot-staging/google-iam-v3beta/gapic_metadata.json +++ /dev/null @@ -1,126 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.iam.v3beta", - "libraryPackage": "::Google::Iam::V3beta", - "services": { - "AccessPolicies": { - "clients": { - "grpc": { - "libraryClient": "::Google::Iam::V3beta::AccessPolicies::Client", - "rpcs": { - "CreateAccessPolicy": { - "methods": [ - "create_access_policy" - ] - }, - "GetAccessPolicy": { - "methods": [ - "get_access_policy" - ] - }, - "UpdateAccessPolicy": { - "methods": [ - "update_access_policy" - ] - }, - "DeleteAccessPolicy": { - "methods": [ - "delete_access_policy" - ] - }, - "ListAccessPolicies": { - "methods": [ - "list_access_policies" - ] - }, - "SearchAccessPolicyBindings": { - "methods": [ - "search_access_policy_bindings" - ] - } - } - } - } - }, - "PolicyBindings": { - "clients": { - "grpc": { - "libraryClient": "::Google::Iam::V3beta::PolicyBindings::Client", - "rpcs": { - "CreatePolicyBinding": { - "methods": [ - "create_policy_binding" - ] - }, - "GetPolicyBinding": { - "methods": [ - "get_policy_binding" - ] - }, - "UpdatePolicyBinding": { - "methods": [ - "update_policy_binding" - ] - }, - "DeletePolicyBinding": { - "methods": [ - "delete_policy_binding" - ] - }, - "ListPolicyBindings": { - "methods": [ - "list_policy_bindings" - ] - }, - "SearchTargetPolicyBindings": { - "methods": [ - "search_target_policy_bindings" - ] - } - } - } - } - }, - "PrincipalAccessBoundaryPolicies": { - "clients": { - "grpc": { - "libraryClient": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client", - "rpcs": { - "CreatePrincipalAccessBoundaryPolicy": { - "methods": [ - "create_principal_access_boundary_policy" - ] - }, - "GetPrincipalAccessBoundaryPolicy": { - "methods": [ - "get_principal_access_boundary_policy" - ] - }, - "UpdatePrincipalAccessBoundaryPolicy": { - "methods": [ - "update_principal_access_boundary_policy" - ] - }, - "DeletePrincipalAccessBoundaryPolicy": { - "methods": [ - "delete_principal_access_boundary_policy" - ] - }, - "ListPrincipalAccessBoundaryPolicies": { - "methods": [ - "list_principal_access_boundary_policies" - ] - }, - "SearchPrincipalAccessBoundaryPolicyBindings": { - "methods": [ - "search_principal_access_boundary_policy_bindings" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta.rb deleted file mode 100644 index 30ca95741887..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta.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/iam/v3beta/access_policies" -require "google/iam/v3beta/policy_bindings" -require "google/iam/v3beta/principal_access_boundary_policies" -require "google/cloud/iam/v3beta/version" - -module Google - module Iam - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/iam/v3beta" - # client = ::Google::Iam::V3beta::AccessPolicies::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/iam/v3beta" - # client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new - # - module V3beta - end - end -end - -helper_path = ::File.join __dir__, "v3beta", "_helpers.rb" -require "google/iam/v3beta/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/operation_metadata_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/operation_metadata_pb.rb deleted file mode 100644 index 84f3e0210548..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/operation_metadata_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/v3beta/operation_metadata.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n*google/iam/v3beta/operation_metadata.proto\x12\x11google.iam.v3beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x42\x94\x01\n\x15\x63om.google.iam.v3betaB\x16OperationMetadataProtoP\x01Z-cloud.google.com/go/iam/apiv3beta/iampb;iampb\xaa\x02\x17Google.Cloud.Iam.V3Beta\xca\x02\x17Google\\Cloud\\Iam\\V3betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Iam - module V3beta - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.OperationMetadata").msgclass - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_binding_resources_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_binding_resources_pb.rb deleted file mode 100644 index ec1093319476..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_binding_resources_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/v3beta/policy_binding_resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/field_info_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' -require 'google/type/expr_pb' - - -descriptor_data = "\n0google/iam/v3beta/policy_binding_resources.proto\x12\x11google.iam.v3beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x16google/type/expr.proto\"\x87\x08\n\rPolicyBinding\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x18\n\x03uid\x18\x02 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12K\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x31.google.iam.v3beta.PolicyBinding.AnnotationsEntryB\x03\xe0\x41\x01\x12?\n\x06target\x18\x06 \x01(\x0b\x32\'.google.iam.v3beta.PolicyBinding.TargetB\x06\xe0\x41\x05\xe0\x41\x02\x12\x45\n\x0bpolicy_kind\x18\x0b \x01(\x0e\x32+.google.iam.v3beta.PolicyBinding.PolicyKindB\x03\xe0\x41\x05\x12\x16\n\x06policy\x18\x07 \x01(\tB\x06\xe0\x41\x05\xe0\x41\x02\x12\x17\n\npolicy_uid\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12)\n\tcondition\x18\x08 \x01(\x0b\x32\x11.google.type.ExprB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x1aI\n\x06Target\x12\x1c\n\rprincipal_set\x18\x01 \x01(\tB\x03\xe0\x41\x05H\x00\x12\x17\n\x08resource\x18\x02 \x01(\tB\x03\xe0\x41\x05H\x00\x42\x08\n\x06target\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"T\n\nPolicyKind\x12\x1b\n\x17POLICY_KIND_UNSPECIFIED\x10\x00\x12\x1d\n\x19PRINCIPAL_ACCESS_BOUNDARY\x10\x01\x12\n\n\x06\x41\x43\x43\x45SS\x10\x02:\xa8\x02\xea\x41\xa4\x02\n iam.googleapis.com/PolicyBinding\x12Qorganizations/{organization}/locations/{location}/policyBindings/{policy_binding}\x12\x45\x66olders/{folder}/locations/{location}/policyBindings/{policy_binding}\x12Gprojects/{project}/locations/{location}/policyBindings/{policy_binding}*\x0epolicyBindings2\rpolicyBindingB\x99\x01\n\x15\x63om.google.iam.v3betaB\x1bPolicyBindingResourcesProtoP\x01Z-cloud.google.com/go/iam/apiv3beta/iampb;iampb\xaa\x02\x17Google.Cloud.Iam.V3Beta\xca\x02\x17Google\\Cloud\\Iam\\V3betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Iam - module V3beta - PolicyBinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.PolicyBinding").msgclass - PolicyBinding::Target = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.PolicyBinding.Target").msgclass - PolicyBinding::PolicyKind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.PolicyBinding.PolicyKind").enummodule - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings.rb deleted file mode 100644 index 18b509490856..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings.rb +++ /dev/null @@ -1,55 +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/iam/v3beta/version" - -require "google/iam/v3beta/policy_bindings/credentials" -require "google/iam/v3beta/policy_bindings/paths" -require "google/iam/v3beta/policy_bindings/operations" -require "google/iam/v3beta/policy_bindings/client" -require "google/iam/v3beta/policy_bindings/rest" - -module Google - module Iam - module V3beta - ## - # An interface for managing Identity and Access Management (IAM) policy - # bindings. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/iam/v3beta/policy_bindings" - # client = ::Google::Iam::V3beta::PolicyBindings::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/iam/v3beta/policy_bindings/rest" - # client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new - # - module PolicyBindings - end - end - end -end - -helper_path = ::File.join __dir__, "policy_bindings", "helpers.rb" -require "google/iam/v3beta/policy_bindings/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/client.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/client.rb deleted file mode 100644 index a7b0d7f2dc80..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/client.rb +++ /dev/null @@ -1,1155 +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/iam/v3beta/policy_bindings_service_pb" -require "google/cloud/location" - -module Google - module Iam - module V3beta - module PolicyBindings - ## - # Client for the PolicyBindings service. - # - # An interface for managing Identity and Access Management (IAM) policy - # bindings. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :policy_bindings_stub - - ## - # Configure the PolicyBindings Client class. - # - # See {::Google::Iam::V3beta::PolicyBindings::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PolicyBindings clients - # ::Google::Iam::V3beta::PolicyBindings::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Iam", "V3beta"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_policy_binding.timeout = 30.0 - - default_config.rpcs.get_policy_binding.timeout = 60.0 - default_config.rpcs.get_policy_binding.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_policy_binding.timeout = 30.0 - - default_config.rpcs.delete_policy_binding.timeout = 30.0 - - default_config.rpcs.list_policy_bindings.timeout = 60.0 - default_config.rpcs.list_policy_bindings.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.search_target_policy_bindings.timeout = 60.0 - default_config.rpcs.search_target_policy_bindings.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the PolicyBindings Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Iam::V3beta::PolicyBindings::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 - @policy_bindings_stub.universe_domain - end - - ## - # Create a new PolicyBindings client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Iam::V3beta::PolicyBindings::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PolicyBindings client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/iam/v3beta/policy_bindings_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 - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @policy_bindings_stub = ::Gapic::ServiceStub.new( - ::Google::Iam::V3beta::PolicyBindings::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 - ) - - @policy_bindings_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 = @policy_bindings_stub.endpoint - config.universe_domain = @policy_bindings_stub.universe_domain - config.logger = @policy_bindings_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Iam::V3beta::PolicyBindings::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @policy_bindings_stub.logger - end - - # Service calls - - ## - # Creates a policy binding and returns a long-running operation. - # Callers will need the IAM permissions on both the policy and target. - # After the binding is created, the policy is applied to the target. - # - # @overload create_policy_binding(request, options = nil) - # Pass arguments to `create_policy_binding` via a request object, either of type - # {::Google::Iam::V3beta::CreatePolicyBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::CreatePolicyBindingRequest, ::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_policy_binding(parent: nil, policy_binding_id: nil, policy_binding: nil, validate_only: nil) - # Pass arguments to `create_policy_binding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this policy binding will be created. - # The binding parent is the closest Resource Manager resource (project, - # folder or organization) to the binding target. - # - # Format: - # - # * `projects/{project_id}/locations/{location}` - # * `projects/{project_number}/locations/{location}` - # * `folders/{folder_id}/locations/{location}` - # * `organizations/{organization_id}/locations/{location}` - # @param policy_binding_id [::String] - # Required. The ID to use for the policy binding, which will become the final - # component of the policy binding's resource name. - # - # This value must start with a lowercase letter followed by up to 62 - # lowercase letters, numbers, hyphens, or dots. Pattern, - # /[a-z][a-z0-9-\.]\\{2,62}/. - # @param policy_binding [::Google::Iam::V3beta::PolicyBinding, ::Hash] - # Required. The policy binding to create. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the creation, but do not - # actually post it. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PolicyBindings::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::CreatePolicyBindingRequest.new - # - # # Call the create_policy_binding method. - # result = client.create_policy_binding request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_policy_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::CreatePolicyBindingRequest - - # 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_policy_binding.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::Iam::V3beta::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_policy_binding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_policy_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policy_bindings_stub.call_rpc :create_policy_binding, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a policy binding. - # - # @overload get_policy_binding(request, options = nil) - # Pass arguments to `get_policy_binding` via a request object, either of type - # {::Google::Iam::V3beta::GetPolicyBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::GetPolicyBindingRequest, ::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_policy_binding(name: nil) - # Pass arguments to `get_policy_binding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the policy binding to retrieve. - # - # Format: - # - # * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` - # * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` - # * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` - # * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V3beta::PolicyBinding] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V3beta::PolicyBinding] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PolicyBindings::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::GetPolicyBindingRequest.new - # - # # Call the get_policy_binding method. - # result = client.get_policy_binding request - # - # # The returned object is of type Google::Iam::V3beta::PolicyBinding. - # p result - # - def get_policy_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::GetPolicyBindingRequest - - # 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_policy_binding.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::Iam::V3beta::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_policy_binding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_policy_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policy_bindings_stub.call_rpc :get_policy_binding, 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 a policy binding and returns a long-running operation. - # Callers will need the IAM permissions on the policy and target in the - # binding to update. Target and policy are immutable and cannot be updated. - # - # @overload update_policy_binding(request, options = nil) - # Pass arguments to `update_policy_binding` via a request object, either of type - # {::Google::Iam::V3beta::UpdatePolicyBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::UpdatePolicyBindingRequest, ::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_policy_binding(policy_binding: nil, validate_only: nil, update_mask: nil) - # Pass arguments to `update_policy_binding` 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 policy_binding [::Google::Iam::V3beta::PolicyBinding, ::Hash] - # Required. The policy binding to update. - # - # The policy binding's `name` field is used to identify the policy binding to - # update. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the update, but do not - # actually post it. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The list of fields to update - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PolicyBindings::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::UpdatePolicyBindingRequest.new - # - # # Call the update_policy_binding method. - # result = client.update_policy_binding request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_policy_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::UpdatePolicyBindingRequest - - # 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_policy_binding.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::Iam::V3beta::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.policy_binding&.name - header_params["policy_binding.name"] = request.policy_binding.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_policy_binding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_policy_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policy_bindings_stub.call_rpc :update_policy_binding, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a policy binding and returns a long-running operation. - # Callers will need the IAM permissions on both the policy and target. - # After the binding is deleted, the policy no longer applies to the target. - # - # @overload delete_policy_binding(request, options = nil) - # Pass arguments to `delete_policy_binding` via a request object, either of type - # {::Google::Iam::V3beta::DeletePolicyBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::DeletePolicyBindingRequest, ::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_policy_binding(name: nil, etag: nil, validate_only: nil) - # Pass arguments to `delete_policy_binding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the policy binding to delete. - # - # Format: - # - # * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` - # * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` - # * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` - # * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` - # @param etag [::String] - # Optional. The etag of the policy binding. - # If this is provided, it must match the server's etag. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the deletion, but do not - # actually post it. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PolicyBindings::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::DeletePolicyBindingRequest.new - # - # # Call the delete_policy_binding method. - # result = client.delete_policy_binding request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_policy_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::DeletePolicyBindingRequest - - # 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_policy_binding.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::Iam::V3beta::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_policy_binding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_policy_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policy_bindings_stub.call_rpc :delete_policy_binding, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists policy bindings. - # - # @overload list_policy_bindings(request, options = nil) - # Pass arguments to `list_policy_bindings` via a request object, either of type - # {::Google::Iam::V3beta::ListPolicyBindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::ListPolicyBindingsRequest, ::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_policy_bindings(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_policy_bindings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource, which owns the collection of policy - # bindings. - # - # Format: - # - # * `projects/{project_id}/locations/{location}` - # * `projects/{project_number}/locations/{location}` - # * `folders/{folder_id}/locations/{location}` - # * `organizations/{organization_id}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of policy bindings to return. The service may - # return fewer than this value. - # - # The default value is 50. The maximum value is 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListPolicyBindings` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListPolicyBindings` must - # match the call that provided the page token. - # @param filter [::String] - # Optional. An expression for filtering the results of the request. Filter - # rules are case insensitive. Some eligible fields for filtering are the - # following: - # - # + `target` - # + `policy` - # - # Some examples of filter queries: - # - # * `target:ex*`: The binding target's name starts with "ex". - # * `target:example`: The binding target's name is `example`. - # * `policy:example`: The binding policy's name is `example`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PolicyBindings::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::ListPolicyBindingsRequest.new - # - # # Call the list_policy_bindings method. - # result = client.list_policy_bindings 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::Iam::V3beta::PolicyBinding. - # p item - # end - # - def list_policy_bindings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::ListPolicyBindingsRequest - - # 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_policy_bindings.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::Iam::V3beta::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_policy_bindings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_policy_bindings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policy_bindings_stub.call_rpc :list_policy_bindings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @policy_bindings_stub, :list_policy_bindings, 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 - - ## - # Search policy bindings by target. Returns all policy binding objects bound - # directly to target. - # - # @overload search_target_policy_bindings(request, options = nil) - # Pass arguments to `search_target_policy_bindings` via a request object, either of type - # {::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest, ::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 search_target_policy_bindings(target: nil, page_size: nil, page_token: nil, parent: nil, filter: nil) - # Pass arguments to `search_target_policy_bindings` 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 target [::String] - # Required. The target resource, which is bound to the policy in the binding. - # - # Format: - # - # * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID` - # * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID` - # * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID` - # * `//cloudresourcemanager.googleapis.com/projects/{project_number}` - # * `//cloudresourcemanager.googleapis.com/folders/{folder_id}` - # * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}` - # @param page_size [::Integer] - # Optional. The maximum number of policy bindings to return. The service may - # return fewer than this value. - # - # The default value is 50. The maximum value is 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous - # `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the - # subsequent page. - # - # When paginating, all other parameters provided to - # `SearchTargetPolicyBindingsRequest` must match the call that provided the - # page token. - # @param parent [::String] - # Required. The parent resource where this search will be performed. This - # should be the nearest Resource Manager resource (project, folder, or - # organization) to the target. - # - # Format: - # - # * `projects/{project_id}/locations/{location}` - # * `projects/{project_number}/locations/{location}` - # * `folders/{folder_id}/locations/{location}` - # * `organizations/{organization_id}/locations/{location}` - # @param filter [::String] - # Optional. Filtering currently only supports the kind of policies to return, - # and must be in the format "policy_kind=\\{policy_kind}". - # - # If String is empty, bindings bound to all kinds of policies would be - # returned. - # - # The only supported values are the following: - # - # * "policy_kind=PRINCIPAL_ACCESS_BOUNDARY", - # * "policy_kind=ACCESS" - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PolicyBindings::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new - # - # # Call the search_target_policy_bindings method. - # result = client.search_target_policy_bindings 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::Iam::V3beta::PolicyBinding. - # p item - # end - # - def search_target_policy_bindings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest - - # 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.search_target_policy_bindings.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::Iam::V3beta::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.search_target_policy_bindings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_target_policy_bindings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policy_bindings_stub.call_rpc :search_target_policy_bindings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @policy_bindings_stub, :search_target_policy_bindings, 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 - - ## - # Configuration class for the PolicyBindings API. - # - # This class represents the configuration for PolicyBindings, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Iam::V3beta::PolicyBindings::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_policy_binding to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Iam::V3beta::PolicyBindings::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_policy_binding.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_policy_binding.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "iam.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 PolicyBindings API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_policy_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :create_policy_binding - ## - # RPC-specific configuration for `get_policy_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :get_policy_binding - ## - # RPC-specific configuration for `update_policy_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :update_policy_binding - ## - # RPC-specific configuration for `delete_policy_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_policy_binding - ## - # RPC-specific configuration for `list_policy_bindings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_policy_bindings - ## - # RPC-specific configuration for `search_target_policy_bindings` - # @return [::Gapic::Config::Method] - # - attr_reader :search_target_policy_bindings - - # @private - def initialize parent_rpcs = nil - create_policy_binding_config = parent_rpcs.create_policy_binding if parent_rpcs.respond_to? :create_policy_binding - @create_policy_binding = ::Gapic::Config::Method.new create_policy_binding_config - get_policy_binding_config = parent_rpcs.get_policy_binding if parent_rpcs.respond_to? :get_policy_binding - @get_policy_binding = ::Gapic::Config::Method.new get_policy_binding_config - update_policy_binding_config = parent_rpcs.update_policy_binding if parent_rpcs.respond_to? :update_policy_binding - @update_policy_binding = ::Gapic::Config::Method.new update_policy_binding_config - delete_policy_binding_config = parent_rpcs.delete_policy_binding if parent_rpcs.respond_to? :delete_policy_binding - @delete_policy_binding = ::Gapic::Config::Method.new delete_policy_binding_config - list_policy_bindings_config = parent_rpcs.list_policy_bindings if parent_rpcs.respond_to? :list_policy_bindings - @list_policy_bindings = ::Gapic::Config::Method.new list_policy_bindings_config - search_target_policy_bindings_config = parent_rpcs.search_target_policy_bindings if parent_rpcs.respond_to? :search_target_policy_bindings - @search_target_policy_bindings = ::Gapic::Config::Method.new search_target_policy_bindings_config - - yield self if block_given? - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/credentials.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/credentials.rb deleted file mode 100644 index 8544d9e0da3c..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/credentials.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 "googleauth" - -module Google - module Iam - module V3beta - module PolicyBindings - # Credentials for the PolicyBindings API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/operations.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/operations.rb deleted file mode 100644 index 0597a41d3fe7..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/operations.rb +++ /dev/null @@ -1,839 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Iam - module V3beta - module PolicyBindings - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the PolicyBindings Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the PolicyBindings Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "iam.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/paths.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/paths.rb deleted file mode 100644 index b4c61be97d31..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/paths.rb +++ /dev/null @@ -1,140 +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 V3beta - module PolicyBindings - # Path helper methods for the PolicyBindings API. - module Paths - ## - # Create a fully-qualified FolderLocation resource string. - # - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}` - # - # @param folder [String] - # @param location [String] - # - # @return [::String] - def folder_location_path folder:, location: - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - - "folders/#{folder}/locations/#{location}" - end - - ## - # Create a fully-qualified Location resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def location_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}" - end - - ## - # Create a fully-qualified OrganizationLocation resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}` - # - # @param organization [String] - # @param location [String] - # - # @return [::String] - def organization_location_path organization:, location: - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}" - end - - ## - # Create a fully-qualified PolicyBinding resource string. - # - # @overload policy_binding_path(organization:, location:, policy_binding:) - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/policyBindings/{policy_binding}` - # - # @param organization [String] - # @param location [String] - # @param policy_binding [String] - # - # @overload policy_binding_path(folder:, location:, policy_binding:) - # The resource will be in the following format: - # - # `folders/{folder}/locations/{location}/policyBindings/{policy_binding}` - # - # @param folder [String] - # @param location [String] - # @param policy_binding [String] - # - # @overload policy_binding_path(project:, location:, policy_binding:) - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/policyBindings/{policy_binding}` - # - # @param project [String] - # @param location [String] - # @param policy_binding [String] - # - # @return [::String] - def policy_binding_path **args - resources = { - "location:organization:policy_binding" => (proc do |organization:, location:, policy_binding:| - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/policyBindings/#{policy_binding}" - end), - "folder:location:policy_binding" => (proc do |folder:, location:, policy_binding:| - raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "folders/#{folder}/locations/#{location}/policyBindings/#{policy_binding}" - end), - "location:policy_binding:project" => (proc do |project:, location:, policy_binding:| - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/policyBindings/#{policy_binding}" - end) - } - - resource = resources[args.keys.sort.join(":")] - raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil? - resource.call(**args) - end - - extend self - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest.rb deleted file mode 100644 index f067a9724971..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest.rb +++ /dev/null @@ -1,52 +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/iam/v3beta/version" - -require "google/iam/v3beta/policy_bindings/credentials" -require "google/iam/v3beta/policy_bindings/paths" -require "google/iam/v3beta/policy_bindings/rest/operations" -require "google/iam/v3beta/policy_bindings/rest/client" - -module Google - module Iam - module V3beta - ## - # An interface for managing Identity and Access Management (IAM) policy - # bindings. - # - # To load this service and instantiate a REST client: - # - # require "google/iam/v3beta/policy_bindings/rest" - # client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new - # - module PolicyBindings - # Client for the REST transport - module Rest - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/iam/v3beta/policy_bindings/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/client.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/client.rb deleted file mode 100644 index 43ed8dc0f6ce..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/client.rb +++ /dev/null @@ -1,1070 +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/iam/v3beta/policy_bindings_service_pb" -require "google/iam/v3beta/policy_bindings/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Iam - module V3beta - module PolicyBindings - module Rest - ## - # REST client for the PolicyBindings service. - # - # An interface for managing Identity and Access Management (IAM) policy - # bindings. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :policy_bindings_stub - - ## - # Configure the PolicyBindings Client class. - # - # See {::Google::Iam::V3beta::PolicyBindings::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PolicyBindings clients - # ::Google::Iam::V3beta::PolicyBindings::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Iam", "V3beta"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_policy_binding.timeout = 30.0 - - default_config.rpcs.get_policy_binding.timeout = 60.0 - default_config.rpcs.get_policy_binding.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_policy_binding.timeout = 30.0 - - default_config.rpcs.delete_policy_binding.timeout = 30.0 - - default_config.rpcs.list_policy_bindings.timeout = 60.0 - default_config.rpcs.list_policy_bindings.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.search_target_policy_bindings.timeout = 60.0 - default_config.rpcs.search_target_policy_bindings.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the PolicyBindings Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Iam::V3beta::PolicyBindings::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 - @policy_bindings_stub.universe_domain - end - - ## - # Create a new PolicyBindings REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PolicyBindings client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Iam::V3beta::PolicyBindings::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @policy_bindings_stub = ::Google::Iam::V3beta::PolicyBindings::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @policy_bindings_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 = @policy_bindings_stub.endpoint - config.universe_domain = @policy_bindings_stub.universe_domain - config.logger = @policy_bindings_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Iam::V3beta::PolicyBindings::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @policy_bindings_stub.logger - end - - # Service calls - - ## - # Creates a policy binding and returns a long-running operation. - # Callers will need the IAM permissions on both the policy and target. - # After the binding is created, the policy is applied to the target. - # - # @overload create_policy_binding(request, options = nil) - # Pass arguments to `create_policy_binding` via a request object, either of type - # {::Google::Iam::V3beta::CreatePolicyBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::CreatePolicyBindingRequest, ::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_policy_binding(parent: nil, policy_binding_id: nil, policy_binding: nil, validate_only: nil) - # Pass arguments to `create_policy_binding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource where this policy binding will be created. - # The binding parent is the closest Resource Manager resource (project, - # folder or organization) to the binding target. - # - # Format: - # - # * `projects/{project_id}/locations/{location}` - # * `projects/{project_number}/locations/{location}` - # * `folders/{folder_id}/locations/{location}` - # * `organizations/{organization_id}/locations/{location}` - # @param policy_binding_id [::String] - # Required. The ID to use for the policy binding, which will become the final - # component of the policy binding's resource name. - # - # This value must start with a lowercase letter followed by up to 62 - # lowercase letters, numbers, hyphens, or dots. Pattern, - # /[a-z][a-z0-9-\.]\\{2,62}/. - # @param policy_binding [::Google::Iam::V3beta::PolicyBinding, ::Hash] - # Required. The policy binding to create. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the creation, but do not - # actually post it. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PolicyBindings::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::CreatePolicyBindingRequest.new - # - # # Call the create_policy_binding method. - # result = client.create_policy_binding request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_policy_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::CreatePolicyBindingRequest - - # 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_policy_binding.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::Iam::V3beta::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_policy_binding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_policy_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policy_bindings_stub.create_policy_binding request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 a policy binding. - # - # @overload get_policy_binding(request, options = nil) - # Pass arguments to `get_policy_binding` via a request object, either of type - # {::Google::Iam::V3beta::GetPolicyBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::GetPolicyBindingRequest, ::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_policy_binding(name: nil) - # Pass arguments to `get_policy_binding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the policy binding to retrieve. - # - # Format: - # - # * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` - # * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` - # * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` - # * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V3beta::PolicyBinding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V3beta::PolicyBinding] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PolicyBindings::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::GetPolicyBindingRequest.new - # - # # Call the get_policy_binding method. - # result = client.get_policy_binding request - # - # # The returned object is of type Google::Iam::V3beta::PolicyBinding. - # p result - # - def get_policy_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::GetPolicyBindingRequest - - # 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_policy_binding.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::Iam::V3beta::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_policy_binding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_policy_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policy_bindings_stub.get_policy_binding 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 a policy binding and returns a long-running operation. - # Callers will need the IAM permissions on the policy and target in the - # binding to update. Target and policy are immutable and cannot be updated. - # - # @overload update_policy_binding(request, options = nil) - # Pass arguments to `update_policy_binding` via a request object, either of type - # {::Google::Iam::V3beta::UpdatePolicyBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::UpdatePolicyBindingRequest, ::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_policy_binding(policy_binding: nil, validate_only: nil, update_mask: nil) - # Pass arguments to `update_policy_binding` 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 policy_binding [::Google::Iam::V3beta::PolicyBinding, ::Hash] - # Required. The policy binding to update. - # - # The policy binding's `name` field is used to identify the policy binding to - # update. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the update, but do not - # actually post it. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The list of fields to update - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PolicyBindings::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::UpdatePolicyBindingRequest.new - # - # # Call the update_policy_binding method. - # result = client.update_policy_binding request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_policy_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::UpdatePolicyBindingRequest - - # 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_policy_binding.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::Iam::V3beta::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_policy_binding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_policy_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policy_bindings_stub.update_policy_binding request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a policy binding and returns a long-running operation. - # Callers will need the IAM permissions on both the policy and target. - # After the binding is deleted, the policy no longer applies to the target. - # - # @overload delete_policy_binding(request, options = nil) - # Pass arguments to `delete_policy_binding` via a request object, either of type - # {::Google::Iam::V3beta::DeletePolicyBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::DeletePolicyBindingRequest, ::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_policy_binding(name: nil, etag: nil, validate_only: nil) - # Pass arguments to `delete_policy_binding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the policy binding to delete. - # - # Format: - # - # * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` - # * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` - # * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` - # * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` - # @param etag [::String] - # Optional. The etag of the policy binding. - # If this is provided, it must match the server's etag. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the deletion, but do not - # actually post it. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PolicyBindings::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::DeletePolicyBindingRequest.new - # - # # Call the delete_policy_binding method. - # result = client.delete_policy_binding request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_policy_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::DeletePolicyBindingRequest - - # 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_policy_binding.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::Iam::V3beta::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_policy_binding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_policy_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policy_bindings_stub.delete_policy_binding request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists policy bindings. - # - # @overload list_policy_bindings(request, options = nil) - # Pass arguments to `list_policy_bindings` via a request object, either of type - # {::Google::Iam::V3beta::ListPolicyBindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::ListPolicyBindingsRequest, ::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_policy_bindings(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_policy_bindings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource, which owns the collection of policy - # bindings. - # - # Format: - # - # * `projects/{project_id}/locations/{location}` - # * `projects/{project_number}/locations/{location}` - # * `folders/{folder_id}/locations/{location}` - # * `organizations/{organization_id}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of policy bindings to return. The service may - # return fewer than this value. - # - # The default value is 50. The maximum value is 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListPolicyBindings` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListPolicyBindings` must - # match the call that provided the page token. - # @param filter [::String] - # Optional. An expression for filtering the results of the request. Filter - # rules are case insensitive. Some eligible fields for filtering are the - # following: - # - # + `target` - # + `policy` - # - # Some examples of filter queries: - # - # * `target:ex*`: The binding target's name starts with "ex". - # * `target:example`: The binding target's name is `example`. - # * `policy:example`: The binding policy's name is `example`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PolicyBindings::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::ListPolicyBindingsRequest.new - # - # # Call the list_policy_bindings method. - # result = client.list_policy_bindings 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::Iam::V3beta::PolicyBinding. - # p item - # end - # - def list_policy_bindings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::ListPolicyBindingsRequest - - # 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_policy_bindings.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::Iam::V3beta::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_policy_bindings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_policy_bindings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policy_bindings_stub.list_policy_bindings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @policy_bindings_stub, :list_policy_bindings, "policy_bindings", 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 - - ## - # Search policy bindings by target. Returns all policy binding objects bound - # directly to target. - # - # @overload search_target_policy_bindings(request, options = nil) - # Pass arguments to `search_target_policy_bindings` via a request object, either of type - # {::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest, ::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 search_target_policy_bindings(target: nil, page_size: nil, page_token: nil, parent: nil, filter: nil) - # Pass arguments to `search_target_policy_bindings` 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 target [::String] - # Required. The target resource, which is bound to the policy in the binding. - # - # Format: - # - # * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID` - # * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID` - # * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID` - # * `//cloudresourcemanager.googleapis.com/projects/{project_number}` - # * `//cloudresourcemanager.googleapis.com/folders/{folder_id}` - # * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}` - # @param page_size [::Integer] - # Optional. The maximum number of policy bindings to return. The service may - # return fewer than this value. - # - # The default value is 50. The maximum value is 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous - # `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the - # subsequent page. - # - # When paginating, all other parameters provided to - # `SearchTargetPolicyBindingsRequest` must match the call that provided the - # page token. - # @param parent [::String] - # Required. The parent resource where this search will be performed. This - # should be the nearest Resource Manager resource (project, folder, or - # organization) to the target. - # - # Format: - # - # * `projects/{project_id}/locations/{location}` - # * `projects/{project_number}/locations/{location}` - # * `folders/{folder_id}/locations/{location}` - # * `organizations/{organization_id}/locations/{location}` - # @param filter [::String] - # Optional. Filtering currently only supports the kind of policies to return, - # and must be in the format "policy_kind=\\{policy_kind}". - # - # If String is empty, bindings bound to all kinds of policies would be - # returned. - # - # The only supported values are the following: - # - # * "policy_kind=PRINCIPAL_ACCESS_BOUNDARY", - # * "policy_kind=ACCESS" - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PolicyBindings::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new - # - # # Call the search_target_policy_bindings method. - # result = client.search_target_policy_bindings 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::Iam::V3beta::PolicyBinding. - # p item - # end - # - def search_target_policy_bindings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest - - # 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.search_target_policy_bindings.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::Iam::V3beta::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.search_target_policy_bindings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_target_policy_bindings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policy_bindings_stub.search_target_policy_bindings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @policy_bindings_stub, :search_target_policy_bindings, "policy_bindings", 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 - - ## - # Configuration class for the PolicyBindings REST API. - # - # This class represents the configuration for PolicyBindings REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Iam::V3beta::PolicyBindings::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_policy_binding to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Iam::V3beta::PolicyBindings::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_policy_binding.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_policy_binding.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "iam.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the PolicyBindings API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_policy_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :create_policy_binding - ## - # RPC-specific configuration for `get_policy_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :get_policy_binding - ## - # RPC-specific configuration for `update_policy_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :update_policy_binding - ## - # RPC-specific configuration for `delete_policy_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_policy_binding - ## - # RPC-specific configuration for `list_policy_bindings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_policy_bindings - ## - # RPC-specific configuration for `search_target_policy_bindings` - # @return [::Gapic::Config::Method] - # - attr_reader :search_target_policy_bindings - - # @private - def initialize parent_rpcs = nil - create_policy_binding_config = parent_rpcs.create_policy_binding if parent_rpcs.respond_to? :create_policy_binding - @create_policy_binding = ::Gapic::Config::Method.new create_policy_binding_config - get_policy_binding_config = parent_rpcs.get_policy_binding if parent_rpcs.respond_to? :get_policy_binding - @get_policy_binding = ::Gapic::Config::Method.new get_policy_binding_config - update_policy_binding_config = parent_rpcs.update_policy_binding if parent_rpcs.respond_to? :update_policy_binding - @update_policy_binding = ::Gapic::Config::Method.new update_policy_binding_config - delete_policy_binding_config = parent_rpcs.delete_policy_binding if parent_rpcs.respond_to? :delete_policy_binding - @delete_policy_binding = ::Gapic::Config::Method.new delete_policy_binding_config - list_policy_bindings_config = parent_rpcs.list_policy_bindings if parent_rpcs.respond_to? :list_policy_bindings - @list_policy_bindings = ::Gapic::Config::Method.new list_policy_bindings_config - search_target_policy_bindings_config = parent_rpcs.search_target_policy_bindings if parent_rpcs.respond_to? :search_target_policy_bindings - @search_target_policy_bindings = ::Gapic::Config::Method.new search_target_policy_bindings_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/operations.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/operations.rb deleted file mode 100644 index 560ac8beaffb..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/operations.rb +++ /dev/null @@ -1,937 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Iam - module V3beta - module PolicyBindings - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the PolicyBindings Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the PolicyBindings Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "iam.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.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_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - 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 cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/service_stub.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/service_stub.rb deleted file mode 100644 index ce126e354617..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings/rest/service_stub.rb +++ /dev/null @@ -1,535 +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/iam/v3beta/policy_bindings_service_pb" - -module Google - module Iam - module V3beta - module PolicyBindings - module Rest - ## - # REST service stub for the PolicyBindings 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 create_policy_binding REST call - # - # @param request_pb [::Google::Iam::V3beta::CreatePolicyBindingRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_policy_binding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_policy_binding_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_policy_binding", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_policy_binding REST call - # - # @param request_pb [::Google::Iam::V3beta::GetPolicyBindingRequest] - # 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::V3beta::PolicyBinding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V3beta::PolicyBinding] - # A result object deserialized from the server's reply - def get_policy_binding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_policy_binding_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_policy_binding", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V3beta::PolicyBinding.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_policy_binding REST call - # - # @param request_pb [::Google::Iam::V3beta::UpdatePolicyBindingRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_policy_binding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_policy_binding_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_policy_binding", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_policy_binding REST call - # - # @param request_pb [::Google::Iam::V3beta::DeletePolicyBindingRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_policy_binding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_policy_binding_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_policy_binding", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_policy_bindings REST call - # - # @param request_pb [::Google::Iam::V3beta::ListPolicyBindingsRequest] - # 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::V3beta::ListPolicyBindingsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V3beta::ListPolicyBindingsResponse] - # A result object deserialized from the server's reply - def list_policy_bindings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_policy_bindings_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_policy_bindings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V3beta::ListPolicyBindingsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_target_policy_bindings REST call - # - # @param request_pb [::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest] - # 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::V3beta::SearchTargetPolicyBindingsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V3beta::SearchTargetPolicyBindingsResponse] - # A result object deserialized from the server's reply - def search_target_policy_bindings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_target_policy_bindings_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: "search_target_policy_bindings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V3beta::SearchTargetPolicyBindingsResponse.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 create_policy_binding REST call - # - # @param request_pb [::Google::Iam::V3beta::CreatePolicyBindingRequest] - # 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_policy_binding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3beta/{parent}/policyBindings", - body: "policy_binding", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3beta/{parent}/policyBindings", - body: "policy_binding", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :post, - uri_template: "/v3beta/{parent}/policyBindings", - body: "policy_binding", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_policy_binding REST call - # - # @param request_pb [::Google::Iam::V3beta::GetPolicyBindingRequest] - # 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_policy_binding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_policy_binding REST call - # - # @param request_pb [::Google::Iam::V3beta::UpdatePolicyBindingRequest] - # 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_policy_binding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3beta/{policy_binding.name}", - body: "policy_binding", - matches: [ - ["policy_binding.name", %r{^projects/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v3beta/{policy_binding.name}", - body: "policy_binding", - matches: [ - ["policy_binding.name", %r{^folders/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :patch, - uri_template: "/v3beta/{policy_binding.name}", - body: "policy_binding", - matches: [ - ["policy_binding.name", %r{^organizations/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_policy_binding REST call - # - # @param request_pb [::Google::Iam::V3beta::DeletePolicyBindingRequest] - # 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_policy_binding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v3beta/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :delete, - uri_template: "/v3beta/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/policyBindings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_policy_bindings REST call - # - # @param request_pb [::Google::Iam::V3beta::ListPolicyBindingsRequest] - # 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_policy_bindings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{parent}/policyBindings", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{parent}/policyBindings", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{parent}/policyBindings", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_target_policy_bindings REST call - # - # @param request_pb [::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_target_policy_bindings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{parent}/policyBindings:searchTargetPolicyBindings", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{parent}/policyBindings:searchTargetPolicyBindings", - matches: [ - ["parent", %r{^folders/[^/]+/locations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{parent}/policyBindings:searchTargetPolicyBindings", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_pb.rb deleted file mode 100644 index 6c9513bee8e7..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_pb.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/v3beta/policy_bindings_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/iam/v3beta/operation_metadata_pb' -require 'google/iam/v3beta/policy_binding_resources_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n/google/iam/v3beta/policy_bindings_service.proto\x12\x11google.iam.v3beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/iam/v3beta/operation_metadata.proto\x1a\x30google/iam/v3beta/policy_binding_resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xd1\x01\n\x1a\x43reatePolicyBindingRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 iam.googleapis.com/PolicyBinding\x12\x1e\n\x11policy_binding_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12=\n\x0epolicy_binding\x18\x03 \x01(\x0b\x32 .google.iam.v3beta.PolicyBindingB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"Q\n\x17GetPolicyBindingRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n iam.googleapis.com/PolicyBinding\"\xad\x01\n\x1aUpdatePolicyBindingRequest\x12=\n\x0epolicy_binding\x18\x01 \x01(\x0b\x32 .google.iam.v3beta.PolicyBindingB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\x83\x01\n\x1a\x44\x65letePolicyBindingRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n iam.googleapis.com/PolicyBinding\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\x9b\x01\n\x19ListPolicyBindingsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 iam.googleapis.com/PolicyBinding\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\"u\n\x1aListPolicyBindingsResponse\x12\x39\n\x0fpolicy_bindings\x18\x01 \x03(\x0b\x32 .google.iam.v3beta.PolicyBinding\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb8\x01\n!SearchTargetPolicyBindingsRequest\x12\x13\n\x06target\x18\x01 \x01(\tB\x03\xe0\x41\x02\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\x38\n\x06parent\x18\x05 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 iam.googleapis.com/PolicyBinding\x12\x13\n\x06\x66ilter\x18\x06 \x01(\tB\x03\xe0\x41\x01\"}\n\"SearchTargetPolicyBindingsResponse\x12\x39\n\x0fpolicy_bindings\x18\x01 \x03(\x0b\x32 .google.iam.v3beta.PolicyBinding\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x32\x8c\x12\n\x0ePolicyBindings\x12\x9c\x03\n\x13\x43reatePolicyBinding\x12-.google.iam.v3beta.CreatePolicyBindingRequest\x1a\x1d.google.longrunning.Operation\"\xb6\x02\xca\x41\"\n\rPolicyBinding\x12\x11OperationMetadata\xda\x41\'parent,policy_binding,policy_binding_id\x82\xd3\xe4\x93\x02\xe0\x01\"6/v3beta/{parent=projects/*/locations/*}/policyBindings:\x0epolicy_bindingZG\"5/v3beta/{parent=folders/*/locations/*}/policyBindings:\x0epolicy_bindingZM\";/v3beta/{parent=organizations/*/locations/*}/policyBindings:\x0epolicy_binding\x12\xa1\x02\n\x10GetPolicyBinding\x12*.google.iam.v3beta.GetPolicyBindingRequest\x1a .google.iam.v3beta.PolicyBinding\"\xbe\x01\xda\x41\x04name\x82\xd3\xe4\x93\x02\xb0\x01\x12\x36/v3beta/{name=projects/*/locations/*/policyBindings/*}Z7\x12\x35/v3beta/{name=folders/*/locations/*/policyBindings/*}Z=\x12;/v3beta/{name=organizations/*/locations/*/policyBindings/*}\x12\xbc\x03\n\x13UpdatePolicyBinding\x12-.google.iam.v3beta.UpdatePolicyBindingRequest\x1a\x1d.google.longrunning.Operation\"\xd6\x02\xca\x41\"\n\rPolicyBinding\x12\x11OperationMetadata\xda\x41\x1apolicy_binding,update_mask\x82\xd3\xe4\x93\x02\x8d\x02\x32\x45/v3beta/{policy_binding.name=projects/*/locations/*/policyBindings/*}:\x0epolicy_bindingZV2D/v3beta/{policy_binding.name=folders/*/locations/*/policyBindings/*}:\x0epolicy_bindingZ\\2J/v3beta/{policy_binding.name=organizations/*/locations/*/policyBindings/*}:\x0epolicy_binding\x12\xd1\x02\n\x13\x44\x65letePolicyBinding\x12-.google.iam.v3beta.DeletePolicyBindingRequest\x1a\x1d.google.longrunning.Operation\"\xeb\x01\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\xb0\x01*6/v3beta/{name=projects/*/locations/*/policyBindings/*}Z7*5/v3beta/{name=folders/*/locations/*/policyBindings/*}Z=*;/v3beta/{name=organizations/*/locations/*/policyBindings/*}\x12\xb4\x02\n\x12ListPolicyBindings\x12,.google.iam.v3beta.ListPolicyBindingsRequest\x1a-.google.iam.v3beta.ListPolicyBindingsResponse\"\xc0\x01\xda\x41\x06parent\x82\xd3\xe4\x93\x02\xb0\x01\x12\x36/v3beta/{parent=projects/*/locations/*}/policyBindingsZ7\x12\x35/v3beta/{parent=folders/*/locations/*}/policyBindingsZ=\x12;/v3beta/{parent=organizations/*/locations/*}/policyBindings\x12\xa4\x03\n\x1aSearchTargetPolicyBindings\x12\x34.google.iam.v3beta.SearchTargetPolicyBindingsRequest\x1a\x35.google.iam.v3beta.SearchTargetPolicyBindingsResponse\"\x98\x02\xda\x41\rparent,target\x82\xd3\xe4\x93\x02\x81\x02\x12Q/v3beta/{parent=projects/*/locations/*}/policyBindings:searchTargetPolicyBindingsZR\x12P/v3beta/{parent=folders/*/locations/*}/policyBindings:searchTargetPolicyBindingsZX\x12V/v3beta/{parent=organizations/*/locations/*}/policyBindings:searchTargetPolicyBindings\x1a\x46\xca\x41\x12iam.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc4\x02\n\x15\x63om.google.iam.v3betaB\x1aPolicyBindingsServiceProtoP\x01Z-cloud.google.com/go/iam/apiv3beta/iampb;iampb\xaa\x02\x17Google.Cloud.Iam.V3Beta\xca\x02\x17Google\\Cloud\\Iam\\V3beta\xea\x41\\\n\'iam.googleapis.com/OrganizationLocation\x12\x31organizations/{organization}/locations/{location}\xea\x41J\n!iam.googleapis.com/FolderLocation\x12%folders/{folder}/locations/{location}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Iam - module V3beta - CreatePolicyBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.CreatePolicyBindingRequest").msgclass - GetPolicyBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.GetPolicyBindingRequest").msgclass - UpdatePolicyBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.UpdatePolicyBindingRequest").msgclass - DeletePolicyBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.DeletePolicyBindingRequest").msgclass - ListPolicyBindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.ListPolicyBindingsRequest").msgclass - ListPolicyBindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.ListPolicyBindingsResponse").msgclass - SearchTargetPolicyBindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.SearchTargetPolicyBindingsRequest").msgclass - SearchTargetPolicyBindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.SearchTargetPolicyBindingsResponse").msgclass - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_services_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_services_pb.rb deleted file mode 100644 index 3261714f198e..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/policy_bindings_service_services_pb.rb +++ /dev/null @@ -1,61 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/iam/v3beta/policy_bindings_service.proto for package 'google.iam.v3beta' -# Original file comments: -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/iam/v3beta/policy_bindings_service_pb' - -module Google - module Iam - module V3beta - module PolicyBindings - # An interface for managing Identity and Access Management (IAM) policy - # bindings. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.iam.v3beta.PolicyBindings' - - # Creates a policy binding and returns a long-running operation. - # Callers will need the IAM permissions on both the policy and target. - # After the binding is created, the policy is applied to the target. - rpc :CreatePolicyBinding, ::Google::Iam::V3beta::CreatePolicyBindingRequest, ::Google::Longrunning::Operation - # Gets a policy binding. - rpc :GetPolicyBinding, ::Google::Iam::V3beta::GetPolicyBindingRequest, ::Google::Iam::V3beta::PolicyBinding - # Updates a policy binding and returns a long-running operation. - # Callers will need the IAM permissions on the policy and target in the - # binding to update. Target and policy are immutable and cannot be updated. - rpc :UpdatePolicyBinding, ::Google::Iam::V3beta::UpdatePolicyBindingRequest, ::Google::Longrunning::Operation - # Deletes a policy binding and returns a long-running operation. - # Callers will need the IAM permissions on both the policy and target. - # After the binding is deleted, the policy no longer applies to the target. - rpc :DeletePolicyBinding, ::Google::Iam::V3beta::DeletePolicyBindingRequest, ::Google::Longrunning::Operation - # Lists policy bindings. - rpc :ListPolicyBindings, ::Google::Iam::V3beta::ListPolicyBindingsRequest, ::Google::Iam::V3beta::ListPolicyBindingsResponse - # Search policy bindings by target. Returns all policy binding objects bound - # directly to target. - rpc :SearchTargetPolicyBindings, ::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest, ::Google::Iam::V3beta::SearchTargetPolicyBindingsResponse - end - - Stub = Service.rpc_stub_class - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies.rb deleted file mode 100644 index 40f474975ea8..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies.rb +++ /dev/null @@ -1,55 +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/iam/v3beta/version" - -require "google/iam/v3beta/principal_access_boundary_policies/credentials" -require "google/iam/v3beta/principal_access_boundary_policies/paths" -require "google/iam/v3beta/principal_access_boundary_policies/operations" -require "google/iam/v3beta/principal_access_boundary_policies/client" -require "google/iam/v3beta/principal_access_boundary_policies/rest" - -module Google - module Iam - module V3beta - ## - # Manages Identity and Access Management (IAM) principal access boundary - # policies. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/iam/v3beta/principal_access_boundary_policies" - # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/iam/v3beta/principal_access_boundary_policies/rest" - # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new - # - module PrincipalAccessBoundaryPolicies - end - end - end -end - -helper_path = ::File.join __dir__, "principal_access_boundary_policies", "helpers.rb" -require "google/iam/v3beta/principal_access_boundary_policies/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/client.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/client.rb deleted file mode 100644 index 3c04a3c916ce..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/client.rb +++ /dev/null @@ -1,1100 +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/iam/v3beta/principal_access_boundary_policies_service_pb" -require "google/cloud/location" - -module Google - module Iam - module V3beta - module PrincipalAccessBoundaryPolicies - ## - # Client for the PrincipalAccessBoundaryPolicies service. - # - # Manages Identity and Access Management (IAM) principal access boundary - # policies. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :principal_access_boundary_policies_stub - - ## - # Configure the PrincipalAccessBoundaryPolicies Client class. - # - # See {::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PrincipalAccessBoundaryPolicies clients - # ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Iam", "V3beta"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_principal_access_boundary_policy.timeout = 30.0 - - default_config.rpcs.get_principal_access_boundary_policy.timeout = 60.0 - default_config.rpcs.get_principal_access_boundary_policy.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_principal_access_boundary_policy.timeout = 30.0 - - default_config.rpcs.delete_principal_access_boundary_policy.timeout = 30.0 - - default_config.rpcs.list_principal_access_boundary_policies.timeout = 60.0 - default_config.rpcs.list_principal_access_boundary_policies.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.search_principal_access_boundary_policy_bindings.timeout = 60.0 - default_config.rpcs.search_principal_access_boundary_policy_bindings.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the PrincipalAccessBoundaryPolicies Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::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 - @principal_access_boundary_policies_stub.universe_domain - end - - ## - # Create a new PrincipalAccessBoundaryPolicies client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PrincipalAccessBoundaryPolicies client. - # @yieldparam config [Client::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/iam/v3beta/principal_access_boundary_policies_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 - - @operations_client = Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @principal_access_boundary_policies_stub = ::Gapic::ServiceStub.new( - ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::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 - ) - - @principal_access_boundary_policies_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 = @principal_access_boundary_policies_stub.endpoint - config.universe_domain = @principal_access_boundary_policies_stub.universe_domain - config.logger = @principal_access_boundary_policies_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @principal_access_boundary_policies_stub.logger - end - - # Service calls - - ## - # Creates a principal access boundary policy, and returns a long running - # operation. - # - # @overload create_principal_access_boundary_policy(request, options = nil) - # Pass arguments to `create_principal_access_boundary_policy` via a request object, either of type - # {::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest, ::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_principal_access_boundary_policy(parent: nil, principal_access_boundary_policy_id: nil, principal_access_boundary_policy: nil, validate_only: nil) - # Pass arguments to `create_principal_access_boundary_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 parent [::String] - # Required. The parent resource where this principal access boundary policy - # will be created. Only organizations are supported. - # - # Format: - # `organizations/{organization_id}/locations/{location}` - # @param principal_access_boundary_policy_id [::String] - # Required. The ID to use for the principal access boundary policy, which - # will become the final component of the principal access boundary policy's - # resource name. - # - # This value must start with a lowercase letter followed by up to 62 - # lowercase letters, numbers, hyphens, or dots. Pattern, - # /[a-z][a-z0-9-\.]\\{2,62}/. - # @param principal_access_boundary_policy [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy, ::Hash] - # Required. The principal access boundary policy to create. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the creation, but do not - # actually post it. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest.new - # - # # Call the create_principal_access_boundary_policy method. - # result = client.create_principal_access_boundary_policy request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_principal_access_boundary_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest - - # 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_principal_access_boundary_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::Iam::V3beta::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_principal_access_boundary_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_principal_access_boundary_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @principal_access_boundary_policies_stub.call_rpc :create_principal_access_boundary_policy, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets a principal access boundary policy. - # - # @overload get_principal_access_boundary_policy(request, options = nil) - # Pass arguments to `get_principal_access_boundary_policy` via a request object, either of type - # {::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest, ::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_principal_access_boundary_policy(name: nil) - # Pass arguments to `get_principal_access_boundary_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 name [::String] - # Required. The name of the principal access boundary policy to retrieve. - # - # Format: - # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest.new - # - # # Call the get_principal_access_boundary_policy method. - # result = client.get_principal_access_boundary_policy request - # - # # The returned object is of type Google::Iam::V3beta::PrincipalAccessBoundaryPolicy. - # p result - # - def get_principal_access_boundary_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest - - # 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_principal_access_boundary_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::Iam::V3beta::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_principal_access_boundary_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_principal_access_boundary_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @principal_access_boundary_policies_stub.call_rpc :get_principal_access_boundary_policy, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Updates a principal access boundary policy. - # - # @overload update_principal_access_boundary_policy(request, options = nil) - # Pass arguments to `update_principal_access_boundary_policy` via a request object, either of type - # {::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest, ::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_principal_access_boundary_policy(principal_access_boundary_policy: nil, validate_only: nil, update_mask: nil) - # Pass arguments to `update_principal_access_boundary_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 principal_access_boundary_policy [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy, ::Hash] - # Required. The principal access boundary policy to update. - # - # The principal access boundary policy's `name` field is used to identify the - # policy to update. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the update, but do not - # actually post it. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The list of fields to update - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest.new - # - # # Call the update_principal_access_boundary_policy method. - # result = client.update_principal_access_boundary_policy request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_principal_access_boundary_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest - - # 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_principal_access_boundary_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::Iam::V3beta::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.principal_access_boundary_policy&.name - header_params["principal_access_boundary_policy.name"] = request.principal_access_boundary_policy.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_principal_access_boundary_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_principal_access_boundary_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @principal_access_boundary_policies_stub.call_rpc :update_principal_access_boundary_policy, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a principal access boundary policy. - # - # @overload delete_principal_access_boundary_policy(request, options = nil) - # Pass arguments to `delete_principal_access_boundary_policy` via a request object, either of type - # {::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest, ::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_principal_access_boundary_policy(name: nil, etag: nil, validate_only: nil, force: nil) - # Pass arguments to `delete_principal_access_boundary_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 name [::String] - # Required. The name of the principal access boundary policy to delete. - # - # Format: - # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` - # @param etag [::String] - # Optional. The etag of the principal access boundary policy. - # If this is provided, it must match the server's etag. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the deletion, but do not - # actually post it. - # @param force [::Boolean] - # Optional. If set to true, the request will force the deletion of the policy - # even if the policy is referenced in policy bindings. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest.new - # - # # Call the delete_principal_access_boundary_policy method. - # result = client.delete_principal_access_boundary_policy request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_principal_access_boundary_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest - - # 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_principal_access_boundary_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::Iam::V3beta::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_principal_access_boundary_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_principal_access_boundary_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @principal_access_boundary_policies_stub.call_rpc :delete_principal_access_boundary_policy, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists principal access boundary policies. - # - # @overload list_principal_access_boundary_policies(request, options = nil) - # Pass arguments to `list_principal_access_boundary_policies` via a request object, either of type - # {::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest, ::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_principal_access_boundary_policies(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_principal_access_boundary_policies` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource, which owns the collection of principal - # access boundary policies. - # - # Format: - # `organizations/{organization_id}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of principal access boundary policies to - # return. The service may return fewer than this value. - # - # If unspecified, at most 50 principal access boundary policies will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous - # `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the - # subsequent page. - # - # When paginating, all other parameters provided to - # `ListPrincipalAccessBoundaryPolicies` must match the call that provided the - # page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest.new - # - # # Call the list_principal_access_boundary_policies method. - # result = client.list_principal_access_boundary_policies 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::Iam::V3beta::PrincipalAccessBoundaryPolicy. - # p item - # end - # - def list_principal_access_boundary_policies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest - - # 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_principal_access_boundary_policies.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::Iam::V3beta::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_principal_access_boundary_policies.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_principal_access_boundary_policies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @principal_access_boundary_policies_stub.call_rpc :list_principal_access_boundary_policies, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @principal_access_boundary_policies_stub, :list_principal_access_boundary_policies, request, response, operation, options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns all policy bindings that bind a specific policy if a user has - # searchPolicyBindings permission on that policy. - # - # @overload search_principal_access_boundary_policy_bindings(request, options = nil) - # Pass arguments to `search_principal_access_boundary_policy_bindings` via a request object, either of type - # {::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest, ::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 search_principal_access_boundary_policy_bindings(name: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_principal_access_boundary_policy_bindings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the principal access boundary policy. - # Format: - # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` - # @param page_size [::Integer] - # Optional. The maximum number of policy bindings to return. The service may - # return fewer than this value. - # - # If unspecified, at most 50 policy bindings will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous - # `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to - # retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call - # that provided the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest.new - # - # # Call the search_principal_access_boundary_policy_bindings method. - # result = client.search_principal_access_boundary_policy_bindings 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::Iam::V3beta::PolicyBinding. - # p item - # end - # - def search_principal_access_boundary_policy_bindings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest - - # 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.search_principal_access_boundary_policy_bindings.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::Iam::V3beta::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.search_principal_access_boundary_policy_bindings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_principal_access_boundary_policy_bindings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @principal_access_boundary_policies_stub.call_rpc :search_principal_access_boundary_policy_bindings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @principal_access_boundary_policies_stub, :search_principal_access_boundary_policy_bindings, 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 - - ## - # Configuration class for the PrincipalAccessBoundaryPolicies API. - # - # This class represents the configuration for PrincipalAccessBoundaryPolicies, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_principal_access_boundary_policy to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_principal_access_boundary_policy.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_principal_access_boundary_policy.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "iam.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 PrincipalAccessBoundaryPolicies API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_principal_access_boundary_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :create_principal_access_boundary_policy - ## - # RPC-specific configuration for `get_principal_access_boundary_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_principal_access_boundary_policy - ## - # RPC-specific configuration for `update_principal_access_boundary_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :update_principal_access_boundary_policy - ## - # RPC-specific configuration for `delete_principal_access_boundary_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_principal_access_boundary_policy - ## - # RPC-specific configuration for `list_principal_access_boundary_policies` - # @return [::Gapic::Config::Method] - # - attr_reader :list_principal_access_boundary_policies - ## - # RPC-specific configuration for `search_principal_access_boundary_policy_bindings` - # @return [::Gapic::Config::Method] - # - attr_reader :search_principal_access_boundary_policy_bindings - - # @private - def initialize parent_rpcs = nil - create_principal_access_boundary_policy_config = parent_rpcs.create_principal_access_boundary_policy if parent_rpcs.respond_to? :create_principal_access_boundary_policy - @create_principal_access_boundary_policy = ::Gapic::Config::Method.new create_principal_access_boundary_policy_config - get_principal_access_boundary_policy_config = parent_rpcs.get_principal_access_boundary_policy if parent_rpcs.respond_to? :get_principal_access_boundary_policy - @get_principal_access_boundary_policy = ::Gapic::Config::Method.new get_principal_access_boundary_policy_config - update_principal_access_boundary_policy_config = parent_rpcs.update_principal_access_boundary_policy if parent_rpcs.respond_to? :update_principal_access_boundary_policy - @update_principal_access_boundary_policy = ::Gapic::Config::Method.new update_principal_access_boundary_policy_config - delete_principal_access_boundary_policy_config = parent_rpcs.delete_principal_access_boundary_policy if parent_rpcs.respond_to? :delete_principal_access_boundary_policy - @delete_principal_access_boundary_policy = ::Gapic::Config::Method.new delete_principal_access_boundary_policy_config - list_principal_access_boundary_policies_config = parent_rpcs.list_principal_access_boundary_policies if parent_rpcs.respond_to? :list_principal_access_boundary_policies - @list_principal_access_boundary_policies = ::Gapic::Config::Method.new list_principal_access_boundary_policies_config - search_principal_access_boundary_policy_bindings_config = parent_rpcs.search_principal_access_boundary_policy_bindings if parent_rpcs.respond_to? :search_principal_access_boundary_policy_bindings - @search_principal_access_boundary_policy_bindings = ::Gapic::Config::Method.new search_principal_access_boundary_policy_bindings_config - - yield self if block_given? - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/credentials.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/credentials.rb deleted file mode 100644 index faa2a134d021..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/credentials.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 "googleauth" - -module Google - module Iam - module V3beta - module PrincipalAccessBoundaryPolicies - # Credentials for the PrincipalAccessBoundaryPolicies API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS_JSON", - "GOOGLE_CLOUD_KEYFILE_JSON", - "GCLOUD_KEYFILE_JSON" - ] - self.paths = [ - "~/.config/google_cloud/application_default_credentials.json" - ] - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/operations.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/operations.rb deleted file mode 100644 index c490d81cb3c9..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/operations.rb +++ /dev/null @@ -1,839 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" -require "google/longrunning/operations_pb" - -module Google - module Iam - module V3beta - module PrincipalAccessBoundaryPolicies - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the PrincipalAccessBoundaryPolicies Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the PrincipalAccessBoundaryPolicies Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # These require statements are intentionally placed here to initialize - # the gRPC module only when it's required. - # See https://github.com/googleapis/toolkit/issues/446 - require "gapic/grpc" - require "google/longrunning/operations_services_pb" - - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = ::Gapic::ServiceStub.new( - ::Google::Longrunning::Operations::Stub, - credentials: credentials, - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - channel_args: @config.channel_args, - interceptors: @config.interceptors, - channel_pool_config: @config.channel_pool - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| - wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } - response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Protobuf::Empty] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - header_params = {} - if request.name - header_params["name"] = request.name - end - - request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") - metadata[:"x-goog-request-params"] ||= request_params_header - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| - yield response, operation if block_given? - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Waits until the specified long-running operation is done or reaches at most - # a specified timeout, returning the latest state. If the operation is - # already done, the latest state is immediately returned. If the timeout - # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC - # timeout is used. If the server does not support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # Note that this method is on a best-effort basis. It may return the latest - # state before the specified timeout (including immediately), meaning even an - # immediate response is no guarantee that the operation is done. - # - # @overload wait_operation(request, options = nil) - # Pass arguments to `wait_operation` via a request object, either of type - # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload wait_operation(name: nil, timeout: nil) - # Pass arguments to `wait_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to wait on. - # @param timeout [::Google::Protobuf::Duration, ::Hash] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::Operation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::WaitOperationRequest.new - # - # # Call the wait_operation method. - # result = client.wait_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def wait_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - metadata = @config.rpcs.wait_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION - metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.wait_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| - response = ::Gapic::Operation.new response, @operations_client, options: options - yield response, operation if block_given? - throw :response, response - end - rescue ::GRPC::BadStatus => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations API. - # - # This class represents the configuration for Operations, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # - # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials - # is deprecated. Providing an unvalidated credential configuration to - # Google APIs can compromise the security of your systems and data. - # - # @example - # - # # The recommended way to provide credentials is to use the `make_creds` method - # # on the appropriate credentials class for your environment. - # - # require "googleauth" - # - # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds( - # json_key_io: ::File.open("/path/to/keyfile.json") - # ) - # - # client = ::Google::Longrunning::Operations::Client.new do |config| - # config.credentials = credentials - # end - # - # @note Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] channel_args - # Extra parameters passed to the gRPC channel. Note: this is ignored if a - # `GRPC::Core::Channel` object is provided as the credential. - # @return [::Hash] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "iam.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration for the channel pool - # @return [::Gapic::ServiceStub::ChannelPool::Configuration] - # - def channel_pool - @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - ## - # RPC-specific configuration for `wait_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :wait_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation - @wait_operation = ::Gapic::Config::Method.new wait_operation_config - - yield self if block_given? - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/paths.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/paths.rb deleted file mode 100644 index 5c221ecd1178..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/paths.rb +++ /dev/null @@ -1,67 +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 V3beta - module PrincipalAccessBoundaryPolicies - # Path helper methods for the PrincipalAccessBoundaryPolicies API. - module Paths - ## - # Create a fully-qualified OrganizationLocation resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}` - # - # @param organization [String] - # @param location [String] - # - # @return [::String] - def organization_location_path organization:, location: - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}" - end - - ## - # Create a fully-qualified PrincipalAccessBoundaryPolicy resource string. - # - # The resource will be in the following format: - # - # `organizations/{organization}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy}` - # - # @param organization [String] - # @param location [String] - # @param principal_access_boundary_policy [String] - # - # @return [::String] - def principal_access_boundary_policy_path organization:, location:, principal_access_boundary_policy: - raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "organizations/#{organization}/locations/#{location}/principalAccessBoundaryPolicies/#{principal_access_boundary_policy}" - end - - extend self - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest.rb deleted file mode 100644 index f65293fe81ac..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest.rb +++ /dev/null @@ -1,52 +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/iam/v3beta/version" - -require "google/iam/v3beta/principal_access_boundary_policies/credentials" -require "google/iam/v3beta/principal_access_boundary_policies/paths" -require "google/iam/v3beta/principal_access_boundary_policies/rest/operations" -require "google/iam/v3beta/principal_access_boundary_policies/rest/client" - -module Google - module Iam - module V3beta - ## - # Manages Identity and Access Management (IAM) principal access boundary - # policies. - # - # To load this service and instantiate a REST client: - # - # require "google/iam/v3beta/principal_access_boundary_policies/rest" - # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new - # - module PrincipalAccessBoundaryPolicies - # Client for the REST transport - module Rest - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/iam/v3beta/principal_access_boundary_policies/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/client.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/client.rb deleted file mode 100644 index d70131af1227..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/client.rb +++ /dev/null @@ -1,1015 +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/iam/v3beta/principal_access_boundary_policies_service_pb" -require "google/iam/v3beta/principal_access_boundary_policies/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Iam - module V3beta - module PrincipalAccessBoundaryPolicies - module Rest - ## - # REST client for the PrincipalAccessBoundaryPolicies service. - # - # Manages Identity and Access Management (IAM) principal access boundary - # policies. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :principal_access_boundary_policies_stub - - ## - # Configure the PrincipalAccessBoundaryPolicies Client class. - # - # See {::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all PrincipalAccessBoundaryPolicies clients - # ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.configure do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Client client. - # @yieldparam config [Client::Configuration] - # - # @return [Client::Configuration] - # - def self.configure - @configure ||= begin - namespace = ["Google", "Iam", "V3beta"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - default_config = Client::Configuration.new parent_config - - default_config.rpcs.create_principal_access_boundary_policy.timeout = 30.0 - - default_config.rpcs.get_principal_access_boundary_policy.timeout = 60.0 - default_config.rpcs.get_principal_access_boundary_policy.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_principal_access_boundary_policy.timeout = 30.0 - - default_config.rpcs.delete_principal_access_boundary_policy.timeout = 30.0 - - default_config.rpcs.list_principal_access_boundary_policies.timeout = 60.0 - default_config.rpcs.list_principal_access_boundary_policies.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.search_principal_access_boundary_policy_bindings.timeout = 60.0 - default_config.rpcs.search_principal_access_boundary_policy_bindings.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the PrincipalAccessBoundaryPolicies Client instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Client.configure}. - # - # See {::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::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 - @principal_access_boundary_policies_stub.universe_domain - end - - ## - # Create a new PrincipalAccessBoundaryPolicies REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the PrincipalAccessBoundaryPolicies client. - # @yieldparam config [Client::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Client.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - # Use self-signed JWT if the endpoint is unchanged from default, - # but only if the default endpoint does not have a region prefix. - enable_self_signed_jwt = @config.endpoint.nil? || - (@config.endpoint == Configuration::DEFAULT_ENDPOINT && - !@config.endpoint.split(".").first.include?("-")) - credentials ||= Credentials.default scope: @config.scope, - enable_self_signed_jwt: enable_self_signed_jwt - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Operations.new do |config| - config.credentials = credentials - config.quota_project = @quota_project_id - config.endpoint = @config.endpoint - config.universe_domain = @config.universe_domain - end - - @principal_access_boundary_policies_stub = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @principal_access_boundary_policies_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 = @principal_access_boundary_policies_stub.endpoint - config.universe_domain = @principal_access_boundary_policies_stub.universe_domain - config.logger = @principal_access_boundary_policies_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Operations] - # - attr_reader :operations_client - - ## - # Get the associated client for mix-in of the Locations. - # - # @return [Google::Cloud::Location::Locations::Rest::Client] - # - attr_reader :location_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @principal_access_boundary_policies_stub.logger - end - - # Service calls - - ## - # Creates a principal access boundary policy, and returns a long running - # operation. - # - # @overload create_principal_access_boundary_policy(request, options = nil) - # Pass arguments to `create_principal_access_boundary_policy` via a request object, either of type - # {::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest, ::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_principal_access_boundary_policy(parent: nil, principal_access_boundary_policy_id: nil, principal_access_boundary_policy: nil, validate_only: nil) - # Pass arguments to `create_principal_access_boundary_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 parent [::String] - # Required. The parent resource where this principal access boundary policy - # will be created. Only organizations are supported. - # - # Format: - # `organizations/{organization_id}/locations/{location}` - # @param principal_access_boundary_policy_id [::String] - # Required. The ID to use for the principal access boundary policy, which - # will become the final component of the principal access boundary policy's - # resource name. - # - # This value must start with a lowercase letter followed by up to 62 - # lowercase letters, numbers, hyphens, or dots. Pattern, - # /[a-z][a-z0-9-\.]\\{2,62}/. - # @param principal_access_boundary_policy [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy, ::Hash] - # Required. The principal access boundary policy to create. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the creation, but do not - # actually post it. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest.new - # - # # Call the create_principal_access_boundary_policy method. - # result = client.create_principal_access_boundary_policy request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def create_principal_access_boundary_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest - - # 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_principal_access_boundary_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::Iam::V3beta::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_principal_access_boundary_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_principal_access_boundary_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @principal_access_boundary_policies_stub.create_principal_access_boundary_policy request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: 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 a principal access boundary policy. - # - # @overload get_principal_access_boundary_policy(request, options = nil) - # Pass arguments to `get_principal_access_boundary_policy` via a request object, either of type - # {::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest, ::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_principal_access_boundary_policy(name: nil) - # Pass arguments to `get_principal_access_boundary_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 name [::String] - # Required. The name of the principal access boundary policy to retrieve. - # - # Format: - # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest.new - # - # # Call the get_principal_access_boundary_policy method. - # result = client.get_principal_access_boundary_policy request - # - # # The returned object is of type Google::Iam::V3beta::PrincipalAccessBoundaryPolicy. - # p result - # - def get_principal_access_boundary_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest - - # 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_principal_access_boundary_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::Iam::V3beta::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_principal_access_boundary_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_principal_access_boundary_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @principal_access_boundary_policies_stub.get_principal_access_boundary_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 - - ## - # Updates a principal access boundary policy. - # - # @overload update_principal_access_boundary_policy(request, options = nil) - # Pass arguments to `update_principal_access_boundary_policy` via a request object, either of type - # {::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest, ::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_principal_access_boundary_policy(principal_access_boundary_policy: nil, validate_only: nil, update_mask: nil) - # Pass arguments to `update_principal_access_boundary_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 principal_access_boundary_policy [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy, ::Hash] - # Required. The principal access boundary policy to update. - # - # The principal access boundary policy's `name` field is used to identify the - # policy to update. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the update, but do not - # actually post it. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. The list of fields to update - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest.new - # - # # Call the update_principal_access_boundary_policy method. - # result = client.update_principal_access_boundary_policy request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def update_principal_access_boundary_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest - - # 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_principal_access_boundary_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::Iam::V3beta::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_principal_access_boundary_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_principal_access_boundary_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @principal_access_boundary_policies_stub.update_principal_access_boundary_policy request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a principal access boundary policy. - # - # @overload delete_principal_access_boundary_policy(request, options = nil) - # Pass arguments to `delete_principal_access_boundary_policy` via a request object, either of type - # {::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest, ::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_principal_access_boundary_policy(name: nil, etag: nil, validate_only: nil, force: nil) - # Pass arguments to `delete_principal_access_boundary_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 name [::String] - # Required. The name of the principal access boundary policy to delete. - # - # Format: - # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` - # @param etag [::String] - # Optional. The etag of the principal access boundary policy. - # If this is provided, it must match the server's etag. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the deletion, but do not - # actually post it. - # @param force [::Boolean] - # Optional. If set to true, the request will force the deletion of the policy - # even if the policy is referenced in policy bindings. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest.new - # - # # Call the delete_principal_access_boundary_policy method. - # result = client.delete_principal_access_boundary_policy request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def delete_principal_access_boundary_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest - - # 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_principal_access_boundary_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::Iam::V3beta::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_principal_access_boundary_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_principal_access_boundary_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @principal_access_boundary_policies_stub.delete_principal_access_boundary_policy request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Lists principal access boundary policies. - # - # @overload list_principal_access_boundary_policies(request, options = nil) - # Pass arguments to `list_principal_access_boundary_policies` via a request object, either of type - # {::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest, ::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_principal_access_boundary_policies(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_principal_access_boundary_policies` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param parent [::String] - # Required. The parent resource, which owns the collection of principal - # access boundary policies. - # - # Format: - # `organizations/{organization_id}/locations/{location}` - # @param page_size [::Integer] - # Optional. The maximum number of principal access boundary policies to - # return. The service may return fewer than this value. - # - # If unspecified, at most 50 principal access boundary policies will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous - # `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the - # subsequent page. - # - # When paginating, all other parameters provided to - # `ListPrincipalAccessBoundaryPolicies` must match the call that provided the - # page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest.new - # - # # Call the list_principal_access_boundary_policies method. - # result = client.list_principal_access_boundary_policies 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::Iam::V3beta::PrincipalAccessBoundaryPolicy. - # p item - # end - # - def list_principal_access_boundary_policies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest - - # 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_principal_access_boundary_policies.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::Iam::V3beta::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_principal_access_boundary_policies.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_principal_access_boundary_policies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @principal_access_boundary_policies_stub.list_principal_access_boundary_policies request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @principal_access_boundary_policies_stub, :list_principal_access_boundary_policies, "principal_access_boundary_policies", 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 - - ## - # Returns all policy bindings that bind a specific policy if a user has - # searchPolicyBindings permission on that policy. - # - # @overload search_principal_access_boundary_policy_bindings(request, options = nil) - # Pass arguments to `search_principal_access_boundary_policy_bindings` via a request object, either of type - # {::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest, ::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 search_principal_access_boundary_policy_bindings(name: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_principal_access_boundary_policy_bindings` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # Required. The name of the principal access boundary policy. - # Format: - # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` - # @param page_size [::Integer] - # Optional. The maximum number of policy bindings to return. The service may - # return fewer than this value. - # - # If unspecified, at most 50 policy bindings will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous - # `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to - # retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call - # that provided the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Iam::V3beta::PolicyBinding>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v3beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest.new - # - # # Call the search_principal_access_boundary_policy_bindings method. - # result = client.search_principal_access_boundary_policy_bindings 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::Iam::V3beta::PolicyBinding. - # p item - # end - # - def search_principal_access_boundary_policy_bindings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest - - # 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.search_principal_access_boundary_policy_bindings.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::Iam::V3beta::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.search_principal_access_boundary_policy_bindings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_principal_access_boundary_policy_bindings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @principal_access_boundary_policies_stub.search_principal_access_boundary_policy_bindings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @principal_access_boundary_policies_stub, :search_principal_access_boundary_policy_bindings, "policy_bindings", 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 - - ## - # Configuration class for the PrincipalAccessBoundaryPolicies REST API. - # - # This class represents the configuration for PrincipalAccessBoundaryPolicies REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # create_principal_access_boundary_policy to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_principal_access_boundary_policy.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_principal_access_boundary_policy.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "iam.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the PrincipalAccessBoundaryPolicies API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `create_principal_access_boundary_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :create_principal_access_boundary_policy - ## - # RPC-specific configuration for `get_principal_access_boundary_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_principal_access_boundary_policy - ## - # RPC-specific configuration for `update_principal_access_boundary_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :update_principal_access_boundary_policy - ## - # RPC-specific configuration for `delete_principal_access_boundary_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_principal_access_boundary_policy - ## - # RPC-specific configuration for `list_principal_access_boundary_policies` - # @return [::Gapic::Config::Method] - # - attr_reader :list_principal_access_boundary_policies - ## - # RPC-specific configuration for `search_principal_access_boundary_policy_bindings` - # @return [::Gapic::Config::Method] - # - attr_reader :search_principal_access_boundary_policy_bindings - - # @private - def initialize parent_rpcs = nil - create_principal_access_boundary_policy_config = parent_rpcs.create_principal_access_boundary_policy if parent_rpcs.respond_to? :create_principal_access_boundary_policy - @create_principal_access_boundary_policy = ::Gapic::Config::Method.new create_principal_access_boundary_policy_config - get_principal_access_boundary_policy_config = parent_rpcs.get_principal_access_boundary_policy if parent_rpcs.respond_to? :get_principal_access_boundary_policy - @get_principal_access_boundary_policy = ::Gapic::Config::Method.new get_principal_access_boundary_policy_config - update_principal_access_boundary_policy_config = parent_rpcs.update_principal_access_boundary_policy if parent_rpcs.respond_to? :update_principal_access_boundary_policy - @update_principal_access_boundary_policy = ::Gapic::Config::Method.new update_principal_access_boundary_policy_config - delete_principal_access_boundary_policy_config = parent_rpcs.delete_principal_access_boundary_policy if parent_rpcs.respond_to? :delete_principal_access_boundary_policy - @delete_principal_access_boundary_policy = ::Gapic::Config::Method.new delete_principal_access_boundary_policy_config - list_principal_access_boundary_policies_config = parent_rpcs.list_principal_access_boundary_policies if parent_rpcs.respond_to? :list_principal_access_boundary_policies - @list_principal_access_boundary_policies = ::Gapic::Config::Method.new list_principal_access_boundary_policies_config - search_principal_access_boundary_policy_bindings_config = parent_rpcs.search_principal_access_boundary_policy_bindings if parent_rpcs.respond_to? :search_principal_access_boundary_policy_bindings - @search_principal_access_boundary_policy_bindings = ::Gapic::Config::Method.new search_principal_access_boundary_policy_bindings_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/operations.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/operations.rb deleted file mode 100644 index 12444ddc3a6e..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/operations.rb +++ /dev/null @@ -1,937 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "gapic/operation" - -module Google - module Iam - module V3beta - module PrincipalAccessBoundaryPolicies - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the PrincipalAccessBoundaryPolicies Operations API. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def self.configure - @configure ||= Operations::Configuration.new - yield @configure if block_given? - @configure - end - - ## - # Configure the PrincipalAccessBoundaryPolicies Operations instance. - # - # The configuration is set to the derived mode, meaning that values can be changed, - # but structural changes (adding new fields, etc.) are not allowed. Structural changes - # should be made on {Operations.configure}. - # - # @yield [config] Configure the Operations client. - # @yieldparam config [Operations::Configuration] - # - # @return [Operations::Configuration] - # - def configure - yield @config if block_given? - @config - end - - ## - # The effective universe domain - # - # @return [String] - # - def universe_domain - @operations_stub.universe_domain - end - - ## - # Create a new Operations client object. - # - # @yield [config] Configure the Client client. - # @yieldparam config [Operations::Configuration] - # - def initialize - # Create the configuration object - @config = Configuration.new Operations.configure - - # Yield the configuration if needed - yield @config if block_given? - - # Create credentials - credentials = @config.credentials - credentials ||= Credentials.default scope: @config.scope - if credentials.is_a?(::String) || credentials.is_a?(::Hash) - credentials = Credentials.new credentials, scope: @config.scope - end - - @quota_project_id = @config.quota_project - @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - @operations_stub = OperationsServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials - ) - - # Used by an LRO wrapper for some methods of this service - @operations_client = self - end - - # Service calls - - ## - # Lists operations that match the specified filter in the request. If the - # server doesn't support this method, it returns `UNIMPLEMENTED`. - # - # @overload list_operations(request, options = nil) - # Pass arguments to `list_operations` via a request object, either of type - # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil) - # Pass arguments to `list_operations` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation's parent resource. - # @param filter [::String] - # The standard list filter. - # @param page_size [::Integer] - # The standard list page size. - # @param page_token [::String] - # The standard list page token. - # @param return_partial_success [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::ListOperationsRequest.new - # - # # Call the list_operations method. - # result = client.list_operations request - # - # # The returned object is of type Gapic::PagedEnumerable. You can iterate - # # over elements, and API calls will be issued to fetch pages as needed. - # result.each do |item| - # # Each element is of type ::Google::Longrunning::Operation. - # p item - # end - # - def list_operations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.list_operations.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.list_operations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.list_operations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @operations_stub, :list_operations, "operations", request, result, options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the latest state of a long-running operation. Clients can use this - # method to poll the operation result at intervals as recommended by the API - # service. - # - # @overload get_operation(request, options = nil) - # Pass arguments to `get_operation` via a request object, either of type - # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload get_operation(name: nil) - # Pass arguments to `get_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Operation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::GetOperationRequest.new - # - # # Call the get_operation method. - # result = client.get_operation request - # - # # The returned object is of type Gapic::Operation. You can use it to - # # check the status of an operation, cancel it, or wait for results. - # # Here is how to wait for a response. - # result.wait_until_done! timeout: 60 - # if result.response? - # p result.response - # else - # puts "No response received." - # end - # - def get_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.get_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.get_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.get_operation request, options do |result, operation| - result = ::Gapic::Operation.new result, @operations_client, options: options - yield result, operation if block_given? - throw :response, result - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Deletes a long-running operation. This method indicates that the client is - # no longer interested in the operation result. It does not cancel the - # operation. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. - # - # @overload delete_operation(request, options = nil) - # Pass arguments to `delete_operation` via a request object, either of type - # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload delete_operation(name: nil) - # Pass arguments to `delete_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be deleted. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::DeleteOperationRequest.new - # - # # Call the delete_operation method. - # result = client.delete_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.delete_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.delete_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Starts asynchronous cancellation on a long-running operation. The server - # makes a best effort to cancel the operation, but success is not - # guaranteed. If the server doesn't support this method, it returns - # `google.rpc.Code.UNIMPLEMENTED`. Clients can use - # Operations.GetOperation or - # other methods to check whether the cancellation succeeded or whether the - # operation completed despite cancellation. On successful cancellation, - # the operation is not deleted; instead, it becomes an operation with - # an {::Google::Longrunning::Operation#error Operation.error} value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of `1`, corresponding to - # `Code.CANCELLED`. - # - # @overload cancel_operation(request, options = nil) - # Pass arguments to `cancel_operation` via a request object, either of type - # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. - # - # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload cancel_operation(name: nil) - # Pass arguments to `cancel_operation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param name [::String] - # The name of the operation resource to be cancelled. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/longrunning" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Longrunning::Operations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Longrunning::CancelOperationRequest.new - # - # # Call the cancel_operation method. - # result = client.cancel_operation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def cancel_operation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest - - # Converts hash and nil to an options object - options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h - - # Customize the options with defaults - call_metadata = @config.rpcs.cancel_operation.metadata.to_h - - # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers - call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ - lib_name: @config.lib_name, lib_version: @config.lib_version, - gapic_version: ::Google::Cloud::Iam::V3beta::VERSION, - transports_version_send: [:rest] - - call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? - call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id - - options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_operation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @operations_stub.cancel_operation request, options do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Configuration class for the Operations REST API. - # - # This class represents the configuration for Operations REST, - # providing control over timeouts, retry behavior, logging, transport - # parameters, and other low-level controls. Certain parameters can also be - # applied individually to specific RPCs. See - # {::Google::Longrunning::Operations::Rest::Client::Configuration::Rpcs} - # for a list of RPCs that can be configured independently. - # - # Configuration can be applied globally to all clients, or to a single client - # on construction. - # - # @example - # - # # Modify the global config, setting the timeout for - # # list_operations to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Longrunning::Operations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Longrunning::Operations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_operations.timeout = 20.0 - # end - # - # @!attribute [rw] endpoint - # A custom service endpoint, as a hostname or hostname:port. The default is - # nil, indicating to use the default endpoint in the current universe domain. - # @return [::String,nil] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client)) - # * (`nil`) indicating no credentials - # - # Warning: If you accept a credential configuration (JSON file or Hash) from an - # external source for authentication to Google Cloud, you must validate it before - # providing it to a Google API client library. Providing an unvalidated credential - # configuration to Google APIs can compromise the security of your systems and data. - # For more information, refer to [Validate credential configurations from external - # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials). - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # @!attribute [rw] universe_domain - # The universe domain within which to make requests. This determines the - # default endpoint URL. The default value of nil uses the environment - # universe (usually the default "googleapis.com" universe). - # @return [::String,nil] - # @!attribute [rw] logger - # A custom logger to use for request/response debug logging, or the value - # `:default` (the default) to construct a default logger, or `nil` to - # explicitly disable logging. - # @return [::Logger,:default,nil] - # - class Configuration - extend ::Gapic::Config - - # @private - # The endpoint specific to the default "googleapis.com" universe. Deprecated. - DEFAULT_ENDPOINT = "iam.googleapis.com" - - config_attr :endpoint, nil, ::String, nil - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil] - allowed.any? { |klass| klass === value } - end - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, ::Proc, nil - config_attr :quota_project, nil, ::String, nil - config_attr :universe_domain, nil, ::String, nil - config_attr :logger, :default, ::Logger, nil, :default - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - - ## - # Configurations for individual RPCs - # @return [Rpcs] - # - def rpcs - @rpcs ||= begin - parent_rpcs = nil - parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) - Rpcs.new parent_rpcs - end - end - - ## - # Configuration RPC class for the Operations API. - # - # Includes fields providing the configuration for each RPC in this service. - # Each configuration object is of type `Gapic::Config::Method` and includes - # the following configuration fields: - # - # * `timeout` (*type:* `Numeric`) - The call timeout in seconds - # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers - # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields - # include the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # - class Rpcs - ## - # RPC-specific configuration for `list_operations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operations - ## - # RPC-specific configuration for `get_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operation - ## - # RPC-specific configuration for `delete_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operation - ## - # RPC-specific configuration for `cancel_operation` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_operation - - # @private - def initialize parent_rpcs = nil - list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations - @list_operations = ::Gapic::Config::Method.new list_operations_config - get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation - @get_operation = ::Gapic::Config::Method.new get_operation_config - delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation - @delete_operation = ::Gapic::Config::Method.new delete_operation_config - cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation - @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config - - yield self if block_given? - end - end - end - end - - ## - # @private - # REST service stub for the Longrunning Operations API. - # Service stub contains baseline method implementations - # including transcoding, making the REST call, and deserialing the response. - class OperationsServiceStub - def initialize endpoint:, endpoint_template:, universe_domain:, credentials: - # These require statements are intentionally placed here to initialize - # the REST modules only when it's required. - require "gapic/rest" - - @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, - endpoint_template: endpoint_template, - universe_domain: universe_domain, - credentials: credentials - end - - ## - # Baseline implementation for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::ListOperationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::ListOperationsResponse] - # A result object deserialized from the server's reply - def list_operations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "list_operations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::ListOperationsResponse.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_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def get_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "get_operation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def delete_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "delete_operation", - 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 cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Protobuf::Empty] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Protobuf::Empty] - # A result object deserialized from the server's reply - def cancel_operation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb - query_string_params = if query_string_params.any? - query_string_params.to_h { |p| p.split "=", 2 } - else - {} - end - - response = @client_stub.make_http_request( - verb, - uri: uri, - body: body || "", - params: query_string_params, - method_name: "cancel_operation", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the list_operations REST call - # - # @param request_pb [::Google::Longrunning::ListOperationsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_list_operations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operation REST call - # - # @param request_pb [::Google::Longrunning::GetOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{name}", - matches: [ - ["name", %r{^folders/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operation REST call - # - # @param request_pb [::Google::Longrunning::DeleteOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_delete_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_operation REST call - # - # @param request_pb [::Google::Longrunning::CancelOperationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_cancel_operation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^operations(?:/.*)?$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/service_stub.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/service_stub.rb deleted file mode 100644 index e36e1d4e8f56..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies/rest/service_stub.rb +++ /dev/null @@ -1,447 +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/iam/v3beta/principal_access_boundary_policies_service_pb" - -module Google - module Iam - module V3beta - module PrincipalAccessBoundaryPolicies - module Rest - ## - # REST service stub for the PrincipalAccessBoundaryPolicies 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 create_principal_access_boundary_policy REST call - # - # @param request_pb [::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def create_principal_access_boundary_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_principal_access_boundary_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: "create_principal_access_boundary_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_principal_access_boundary_policy REST call - # - # @param request_pb [::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest] - # 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::V3beta::PrincipalAccessBoundaryPolicy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy] - # A result object deserialized from the server's reply - def get_principal_access_boundary_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_principal_access_boundary_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_principal_access_boundary_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy.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_principal_access_boundary_policy REST call - # - # @param request_pb [::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def update_principal_access_boundary_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_principal_access_boundary_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: "update_principal_access_boundary_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_principal_access_boundary_policy REST call - # - # @param request_pb [::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest] - # A request object representing the call parameters. Required. - # @param options [::Gapic::CallOptions] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Longrunning::Operation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Longrunning::Operation] - # A result object deserialized from the server's reply - def delete_principal_access_boundary_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_principal_access_boundary_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: "delete_principal_access_boundary_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Longrunning::Operation.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_principal_access_boundary_policies REST call - # - # @param request_pb [::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest] - # 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::V3beta::ListPrincipalAccessBoundaryPoliciesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesResponse] - # A result object deserialized from the server's reply - def list_principal_access_boundary_policies request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_principal_access_boundary_policies_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_principal_access_boundary_policies", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_principal_access_boundary_policy_bindings REST call - # - # @param request_pb [::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest] - # 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::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsResponse] - # A result object deserialized from the server's reply - def search_principal_access_boundary_policy_bindings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_principal_access_boundary_policy_bindings_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: "search_principal_access_boundary_policy_bindings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsResponse.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 create_principal_access_boundary_policy REST call - # - # @param request_pb [::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest] - # 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_principal_access_boundary_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v3beta/{parent}/principalAccessBoundaryPolicies", - body: "principal_access_boundary_policy", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_principal_access_boundary_policy REST call - # - # @param request_pb [::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest] - # 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_principal_access_boundary_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/principalAccessBoundaryPolicies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_principal_access_boundary_policy REST call - # - # @param request_pb [::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest] - # 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_principal_access_boundary_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v3beta/{principal_access_boundary_policy.name}", - body: "principal_access_boundary_policy", - matches: [ - ["principal_access_boundary_policy.name", %r{^organizations/[^/]+/locations/[^/]+/principalAccessBoundaryPolicies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_principal_access_boundary_policy REST call - # - # @param request_pb [::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest] - # 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_principal_access_boundary_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v3beta/{name}", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/principalAccessBoundaryPolicies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_principal_access_boundary_policies REST call - # - # @param request_pb [::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest] - # 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_principal_access_boundary_policies_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{parent}/principalAccessBoundaryPolicies", - matches: [ - ["parent", %r{^organizations/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_principal_access_boundary_policy_bindings REST call - # - # @param request_pb [::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_principal_access_boundary_policy_bindings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v3beta/{name}:searchPolicyBindings", - matches: [ - ["name", %r{^organizations/[^/]+/locations/[^/]+/principalAccessBoundaryPolicies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies_service_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies_service_pb.rb deleted file mode 100644 index ee829930af81..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies_service_pb.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/v3beta/principal_access_boundary_policies_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/iam/v3beta/operation_metadata_pb' -require 'google/iam/v3beta/policy_binding_resources_pb' -require 'google/iam/v3beta/principal_access_boundary_policy_resources_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\nBgoogle/iam/v3beta/principal_access_boundary_policies_service.proto\x12\x11google.iam.v3beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a*google/iam/v3beta/operation_metadata.proto\x1a\x30google/iam/v3beta/policy_binding_resources.proto\x1a\x42google/iam/v3beta/principal_access_boundary_policy_resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xa5\x02\n*CreatePrincipalAccessBoundaryPolicyRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\x12\x30iam.googleapis.com/PrincipalAccessBoundaryPolicy\x12\x30\n#principal_access_boundary_policy_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12_\n principal_access_boundary_policy\x18\x03 \x01(\x0b\x32\x30.google.iam.v3beta.PrincipalAccessBoundaryPolicyB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"q\n\'GetPrincipalAccessBoundaryPolicyRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0iam.googleapis.com/PrincipalAccessBoundaryPolicy\"\xdf\x01\n*UpdatePrincipalAccessBoundaryPolicyRequest\x12_\n principal_access_boundary_policy\x18\x01 \x01(\x0b\x32\x30.google.iam.v3beta.PrincipalAccessBoundaryPolicyB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\"\xb7\x01\n*DeletePrincipalAccessBoundaryPolicyRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0iam.googleapis.com/PrincipalAccessBoundaryPolicy\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xa7\x01\n*ListPrincipalAccessBoundaryPoliciesRequest\x12H\n\x06parent\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\x12\x30iam.googleapis.com/PrincipalAccessBoundaryPolicy\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\"\xa9\x01\n+ListPrincipalAccessBoundaryPoliciesResponse\x12\\\n\"principal_access_boundary_policies\x18\x01 \x03(\x0b\x32\x30.google.iam.v3beta.PrincipalAccessBoundaryPolicy\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xad\x01\n2SearchPrincipalAccessBoundaryPolicyBindingsRequest\x12\x46\n\x04name\x18\x01 \x01(\tB8\xe0\x41\x02\xfa\x41\x32\n0iam.googleapis.com/PrincipalAccessBoundaryPolicy\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x8e\x01\n3SearchPrincipalAccessBoundaryPolicyBindingsResponse\x12\x39\n\x0fpolicy_bindings\x18\x01 \x03(\x0b\x32 .google.iam.v3beta.PolicyBinding\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x32\xa8\x0f\n\x1fPrincipalAccessBoundaryPolicies\x12\xff\x02\n#CreatePrincipalAccessBoundaryPolicy\x12=.google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest\x1a\x1d.google.longrunning.Operation\"\xf9\x01\xca\x41\x32\n\x1dPrincipalAccessBoundaryPolicy\x12\x11OperationMetadata\xda\x41Kparent,principal_access_boundary_policy,principal_access_boundary_policy_id\x82\xd3\xe4\x93\x02p\"L/v3beta/{parent=organizations/*/locations/*}/principalAccessBoundaryPolicies: principal_access_boundary_policy\x12\xed\x01\n GetPrincipalAccessBoundaryPolicy\x12:.google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest\x1a\x30.google.iam.v3beta.PrincipalAccessBoundaryPolicy\"[\xda\x41\x04name\x82\xd3\xe4\x93\x02N\x12L/v3beta/{name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}\x12\x82\x03\n#UpdatePrincipalAccessBoundaryPolicy\x12=.google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest\x1a\x1d.google.longrunning.Operation\"\xfc\x01\xca\x41\x32\n\x1dPrincipalAccessBoundaryPolicy\x12\x11OperationMetadata\xda\x41,principal_access_boundary_policy,update_mask\x82\xd3\xe4\x93\x02\x91\x01\x32m/v3beta/{principal_access_boundary_policy.name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}: principal_access_boundary_policy\x12\x8e\x02\n#DeletePrincipalAccessBoundaryPolicy\x12=.google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest\x1a\x1d.google.longrunning.Operation\"\x88\x01\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02N*L/v3beta/{name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}\x12\x83\x02\n#ListPrincipalAccessBoundaryPolicies\x12=.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest\x1a>.google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse\"]\xda\x41\x06parent\x82\xd3\xe4\x93\x02N\x12L/v3beta/{parent=organizations/*/locations/*}/principalAccessBoundaryPolicies\x12\xae\x02\n+SearchPrincipalAccessBoundaryPolicyBindings\x12\x45.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest\x1a\x46.google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse\"p\xda\x41\x04name\x82\xd3\xe4\x93\x02\x63\x12\x61/v3beta/{name=organizations/*/locations/*/principalAccessBoundaryPolicies/*}:searchPolicyBindings\x1a\x46\xca\x41\x12iam.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa9\x01\n\x15\x63om.google.iam.v3betaB+PrincipalAccessBoundaryPoliciesServiceProtoP\x01Z-cloud.google.com/go/iam/apiv3beta/iampb;iampb\xaa\x02\x17Google.Cloud.Iam.V3Beta\xca\x02\x17Google\\Cloud\\Iam\\V3betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Iam - module V3beta - CreatePrincipalAccessBoundaryPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.CreatePrincipalAccessBoundaryPolicyRequest").msgclass - GetPrincipalAccessBoundaryPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.GetPrincipalAccessBoundaryPolicyRequest").msgclass - UpdatePrincipalAccessBoundaryPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.UpdatePrincipalAccessBoundaryPolicyRequest").msgclass - DeletePrincipalAccessBoundaryPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.DeletePrincipalAccessBoundaryPolicyRequest").msgclass - ListPrincipalAccessBoundaryPoliciesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesRequest").msgclass - ListPrincipalAccessBoundaryPoliciesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.ListPrincipalAccessBoundaryPoliciesResponse").msgclass - SearchPrincipalAccessBoundaryPolicyBindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsRequest").msgclass - SearchPrincipalAccessBoundaryPolicyBindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.SearchPrincipalAccessBoundaryPolicyBindingsResponse").msgclass - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies_service_services_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies_service_services_pb.rb deleted file mode 100644 index 3789b868b8e2..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policies_service_services_pb.rb +++ /dev/null @@ -1,56 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/iam/v3beta/principal_access_boundary_policies_service.proto for package 'google.iam.v3beta' -# Original file comments: -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'google/iam/v3beta/principal_access_boundary_policies_service_pb' - -module Google - module Iam - module V3beta - module PrincipalAccessBoundaryPolicies - # Manages Identity and Access Management (IAM) principal access boundary - # policies. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.iam.v3beta.PrincipalAccessBoundaryPolicies' - - # Creates a principal access boundary policy, and returns a long running - # operation. - rpc :CreatePrincipalAccessBoundaryPolicy, ::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest, ::Google::Longrunning::Operation - # Gets a principal access boundary policy. - rpc :GetPrincipalAccessBoundaryPolicy, ::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest, ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy - # Updates a principal access boundary policy. - rpc :UpdatePrincipalAccessBoundaryPolicy, ::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest, ::Google::Longrunning::Operation - # Deletes a principal access boundary policy. - rpc :DeletePrincipalAccessBoundaryPolicy, ::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest, ::Google::Longrunning::Operation - # Lists principal access boundary policies. - rpc :ListPrincipalAccessBoundaryPolicies, ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest, ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesResponse - # Returns all policy bindings that bind a specific policy if a user has - # searchPolicyBindings permission on that policy. - rpc :SearchPrincipalAccessBoundaryPolicyBindings, ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest, ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsResponse - end - - Stub = Service.rpc_stub_class - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policy_resources_pb.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policy_resources_pb.rb deleted file mode 100644 index aeddd8701494..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/principal_access_boundary_policy_resources_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/v3beta/principal_access_boundary_policy_resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/field_info_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\nBgoogle/iam/v3beta/principal_access_boundary_policy_resources.proto\x12\x11google.iam.v3beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb5\x05\n\x1dPrincipalAccessBoundaryPolicy\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x08\x12\x18\n\x03uid\x18\x02 \x01(\tB\x0b\xe0\x41\x03\xe2\x8c\xcf\xd7\x08\x02\x08\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12[\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x41.google.iam.v3beta.PrincipalAccessBoundaryPolicy.AnnotationsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12M\n\x07\x64\x65tails\x18\x08 \x01(\x0b\x32\x37.google.iam.v3beta.PrincipalAccessBoundaryPolicyDetailsB\x03\xe0\x41\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:\xec\x01\xea\x41\xe8\x01\n0iam.googleapis.com/PrincipalAccessBoundaryPolicy\x12torganizations/{organization}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy}*\x1fprincipalAccessBoundaryPolicies2\x1dprincipalAccessBoundaryPolicy\"\x92\x01\n$PrincipalAccessBoundaryPolicyDetails\x12H\n\x05rules\x18\x01 \x03(\x0b\x32\x34.google.iam.v3beta.PrincipalAccessBoundaryPolicyRuleB\x03\xe0\x41\x02\x12 \n\x13\x65nforcement_version\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xd4\x01\n!PrincipalAccessBoundaryPolicyRule\x12\x18\n\x0b\x64\x65scription\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tresources\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12P\n\x06\x65\x66\x66\x65\x63t\x18\x03 \x01(\x0e\x32;.google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.EffectB\x03\xe0\x41\x02\"+\n\x06\x45\x66\x66\x65\x63t\x12\x16\n\x12\x45\x46\x46\x45\x43T_UNSPECIFIED\x10\x00\x12\t\n\x05\x41LLOW\x10\x01\x42\xa9\x01\n\x15\x63om.google.iam.v3betaB+PrincipalAccessBoundaryPolicyResourcesProtoP\x01Z-cloud.google.com/go/iam/apiv3beta/iampb;iampb\xaa\x02\x17Google.Cloud.Iam.V3Beta\xca\x02\x17Google\\Cloud\\Iam\\V3betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Iam - module V3beta - PrincipalAccessBoundaryPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.PrincipalAccessBoundaryPolicy").msgclass - PrincipalAccessBoundaryPolicyDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.PrincipalAccessBoundaryPolicyDetails").msgclass - PrincipalAccessBoundaryPolicyRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.PrincipalAccessBoundaryPolicyRule").msgclass - PrincipalAccessBoundaryPolicyRule::Effect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v3beta.PrincipalAccessBoundaryPolicyRule.Effect").enummodule - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/rest.rb b/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/rest.rb deleted file mode 100644 index 9397ad516c7c..000000000000 --- a/owl-bot-staging/google-iam-v3beta/lib/google/iam/v3beta/rest.rb +++ /dev/null @@ -1,37 +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/iam/v3beta/access_policies/rest" -require "google/iam/v3beta/policy_bindings/rest" -require "google/iam/v3beta/principal_access_boundary_policies/rest" -require "google/cloud/iam/v3beta/version" - -module Google - module Iam - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/iam/v3beta/rest" - # client = ::Google::Iam::V3beta::AccessPolicies::Rest::Client.new - # - module V3beta - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/README.md b/owl-bot-staging/google-iam-v3beta/proto_docs/README.md deleted file mode 100644 index 536b687b8e98..000000000000 --- a/owl-bot-staging/google-iam-v3beta/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Identity and Access Management (IAM) V3BETA Protocol Buffer Documentation - -These files are for the YARD documentation of the generated protobuf files. -They are not intended to be required or loaded at runtime. diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/client.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Required information for every language. - # @!attribute [rw] reference_docs_uri - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Link to automatically generated reference documentation. Example: - # https://cloud.google.com/nodejs/docs/reference/asset/latest - # @!attribute [rw] destinations - # @return [::Array<::Google::Api::ClientLibraryDestination>] - # The destination where API teams want this client library to be published. - # @!attribute [rw] selective_gapic_generation - # @return [::Google::Api::SelectiveGapicGeneration] - # Configuration for which RPCs should be generated in the GAPIC client. - # - # 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-iam-v3beta/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/field_info.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Api - # Rich semantic information of an API field beyond basic typing. - # @!attribute [rw] format - # @return [::Google::Api::FieldInfo::Format] - # The standard format of a field value. This does not explicitly configure - # any API consumer, just documents the API's format for the field it is - # applied to. - # @!attribute [rw] referenced_types - # @return [::Array<::Google::Api::TypeReference>] - # The type(s) that the annotated, generic field may represent. - # - # Currently, this must only be used on fields of type `google.protobuf.Any`. - # Supporting other generic types may be considered in the future. - class FieldInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The standard format of a field value. The supported formats are all backed - # by either an RFC defined by the IETF or a Google-defined AIP. - module Format - # Default, unspecified value. - FORMAT_UNSPECIFIED = 0 - - # Universally Unique Identifier, version 4, value as defined by - # https://datatracker.ietf.org/doc/html/rfc4122. The value may be - # normalized to entirely lowercase letters. For example, the value - # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to - # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. - UUID4 = 1 - - # Internet Protocol v4 value as defined by [RFC - # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be - # condensed, with leading zeros in each octet stripped. For example, - # `001.022.233.040` would be condensed to `1.22.233.40`. - IPV4 = 2 - - # Internet Protocol v6 value as defined by [RFC - # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be - # normalized to entirely lowercase letters with zeros compressed, following - # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, - # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. - IPV6 = 3 - - # An IP address in either v4 or v6 format as described by the individual - # values defined herein. See the comments on the IPV4 and IPV6 types for - # allowed normalizations of each. - IPV4_OR_IPV6 = 4 - end - end - - # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. - # @!attribute [rw] type_name - # @return [::String] - # The name of the type that the annotated, generic field may represent. - # If the type is in the same protobuf package, the value can be the simple - # message name e.g., `"MyMessage"`. Otherwise, the value must be the - # fully-qualified message name e.g., `"google.library.v1.Book"`. - # - # If the type(s) are unknown to the service (e.g. the field accepts generic - # user input), use the wildcard `"*"` to denote this behavior. - # - # See [AIP-202](https://google.aip.dev/202#type-references) for more details. - class TypeReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/proto_docs/google/api/resource.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/proto_docs/google/iam/v3beta/operation_metadata.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/operation_metadata.rb deleted file mode 100644 index 4e4463d9171f..000000000000 --- a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/operation_metadata.rb +++ /dev/null @@ -1,55 +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 V3beta - # Represents the metadata of the long-running operation. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] status_message - # @return [::String] - # Output only. Human-readable status of the operation, if any. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. Operations that have successfully been cancelled - # have [Operation.error][] value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to - # `Code.CANCELLED`. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_binding_resources.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_binding_resources.rb deleted file mode 100644 index c46446dc0080..000000000000 --- a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_binding_resources.rb +++ /dev/null @@ -1,193 +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 V3beta - # IAM policy binding resource. - # @!attribute [rw] name - # @return [::String] - # Identifier. The name of the policy binding, in the format - # `{binding_parent/locations/{location}/policyBindings/{policy_binding_id}`. - # The binding parent is the closest Resource Manager resource (project, - # folder, or organization) to the binding target. - # - # Format: - # - # * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` - # * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` - # * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` - # * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` - # @!attribute [r] uid - # @return [::String] - # Output only. The globally unique ID of the policy binding. Assigned when - # the policy binding is created. - # @!attribute [rw] etag - # @return [::String] - # Optional. The etag for the policy binding. - # If this is provided on update, it must match the server's etag. - # @!attribute [rw] display_name - # @return [::String] - # Optional. The description of the policy binding. Must be less than or equal - # to 63 characters. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. User-defined annotations. See - # https://google.aip.dev/148#annotations for more details such as format and - # size limitations - # @!attribute [rw] target - # @return [::Google::Iam::V3beta::PolicyBinding::Target] - # Required. Immutable. The full resource name of the resource to which the - # policy will be bound. Immutable once set. - # @!attribute [rw] policy_kind - # @return [::Google::Iam::V3beta::PolicyBinding::PolicyKind] - # Immutable. The kind of the policy to attach in this binding. This field - # must be one of the following: - # - # - Left empty (will be automatically set to the policy kind) - # - The input policy kind - # @!attribute [rw] policy - # @return [::String] - # Required. Immutable. The resource name of the policy to be bound. The - # binding parent and policy must belong to the same organization. - # @!attribute [r] policy_uid - # @return [::String] - # Output only. The globally unique ID of the policy to be bound. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # Optional. The condition to apply to the policy binding. When set, the - # `expression` field in the `Expr` must include from 1 to 10 subexpressions, - # joined by the - # "||"(Logical OR), "&&"(Logical AND) or "!"(Logical NOT) operators and - # cannot contain more than 250 characters. - # - # The condition is currently only supported when bound to policies of kind - # principal access boundary. - # - # When the bound policy is a principal access boundary policy, the only - # supported attributes in any subexpression are `principal.type` and - # `principal.subject`. An example expression is: "principal.type == - # 'iam.googleapis.com/ServiceAccount'" or "principal.subject == - # 'bob@example.com'". - # - # Allowed operations for `principal.subject`: - # - # - `principal.subject == ` - # - `principal.subject != ` - # - `principal.subject in []` - # - `principal.subject.startsWith()` - # - `principal.subject.endsWith()` - # - # Allowed operations for `principal.type`: - # - # - `principal.type == ` - # - `principal.type != ` - # - `principal.type in []` - # - # Supported principal types are workspace, workforce pool, workload pool, - # service account, and Agent Identity. Allowed string must be one of: - # - # - `iam.googleapis.com/WorkspaceIdentity` - # - `iam.googleapis.com/WorkforcePoolIdentity` - # - `iam.googleapis.com/WorkloadPoolIdentity` - # - `iam.googleapis.com/ServiceAccount` - # - `iam.googleapis.com/AgentPoolIdentity` (available in Preview) - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the policy binding was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the policy binding was most recently updated. - class PolicyBinding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The full resource name of the resource to which the policy will - # be bound. Immutable once set. - # @!attribute [rw] principal_set - # @return [::String] - # Immutable. The full resource name that's used for principal access - # boundary policy bindings. The principal set must be directly parented - # by the policy binding's parent or same as the parent if the target is a - # project, folder, or organization. - # - # Examples: - # - # * For bindings parented by an organization: - # * Organization: - # `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID` - # * Workforce Identity: - # `//iam.googleapis.com/locations/global/workforcePools/WORKFORCE_POOL_ID` - # * Workspace Identity: - # `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID` - # * For bindings parented by a folder: - # * Folder: - # `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID` - # * For bindings parented by a project: - # * Project: - # * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER` - # * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID` - # * Workload Identity Pool: - # `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/LOCATION/workloadIdentityPools/WORKLOAD_POOL_ID` - # - # Note: The following fields are mutually exclusive: `principal_set`, `resource`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] resource - # @return [::String] - # Immutable. The full resource name that's used for access policy - # bindings. - # - # Examples: - # - # * Organization: - # `//cloudresourcemanager.googleapis.com/organizations/ORGANIZATION_ID` - # * Folder: `//cloudresourcemanager.googleapis.com/folders/FOLDER_ID` - # * Project: - # * `//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER` - # * `//cloudresourcemanager.googleapis.com/projects/PROJECT_ID` - # - # Note: The following fields are mutually exclusive: `resource`, `principal_set`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Target - 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 - - # The different policy kinds supported in this binding. - module PolicyKind - # Unspecified policy kind; Not a valid state - POLICY_KIND_UNSPECIFIED = 0 - - # Principal access boundary policy kind - PRINCIPAL_ACCESS_BOUNDARY = 1 - - # Access policy kind. - ACCESS = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_bindings_service.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_bindings_service.rb deleted file mode 100644 index 4ff232b4471d..000000000000 --- a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/policy_bindings_service.rb +++ /dev/null @@ -1,243 +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 V3beta - # Request message for CreatePolicyBinding method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this policy binding will be created. - # The binding parent is the closest Resource Manager resource (project, - # folder or organization) to the binding target. - # - # Format: - # - # * `projects/{project_id}/locations/{location}` - # * `projects/{project_number}/locations/{location}` - # * `folders/{folder_id}/locations/{location}` - # * `organizations/{organization_id}/locations/{location}` - # @!attribute [rw] policy_binding_id - # @return [::String] - # Required. The ID to use for the policy binding, which will become the final - # component of the policy binding's resource name. - # - # This value must start with a lowercase letter followed by up to 62 - # lowercase letters, numbers, hyphens, or dots. Pattern, - # /[a-z][a-z0-9-\.]\\{2,62}/. - # @!attribute [rw] policy_binding - # @return [::Google::Iam::V3beta::PolicyBinding] - # Required. The policy binding to create. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the creation, but do not - # actually post it. - class CreatePolicyBindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetPolicyBinding method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the policy binding to retrieve. - # - # Format: - # - # * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` - # * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` - # * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` - # * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` - class GetPolicyBindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdatePolicyBinding method. - # @!attribute [rw] policy_binding - # @return [::Google::Iam::V3beta::PolicyBinding] - # Required. The policy binding to update. - # - # The policy binding's `name` field is used to identify the policy binding to - # update. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the update, but do not - # actually post it. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The list of fields to update - class UpdatePolicyBindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeletePolicyBinding method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the policy binding to delete. - # - # Format: - # - # * `projects/{project_id}/locations/{location}/policyBindings/{policy_binding_id}` - # * `projects/{project_number}/locations/{location}/policyBindings/{policy_binding_id}` - # * `folders/{folder_id}/locations/{location}/policyBindings/{policy_binding_id}` - # * `organizations/{organization_id}/locations/{location}/policyBindings/{policy_binding_id}` - # @!attribute [rw] etag - # @return [::String] - # Optional. The etag of the policy binding. - # If this is provided, it must match the server's etag. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the deletion, but do not - # actually post it. - class DeletePolicyBindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListPolicyBindings method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource, which owns the collection of policy - # bindings. - # - # Format: - # - # * `projects/{project_id}/locations/{location}` - # * `projects/{project_number}/locations/{location}` - # * `folders/{folder_id}/locations/{location}` - # * `organizations/{organization_id}/locations/{location}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of policy bindings to return. The service may - # return fewer than this value. - # - # The default value is 50. The maximum value is 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous `ListPolicyBindings` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListPolicyBindings` must - # match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Optional. An expression for filtering the results of the request. Filter - # rules are case insensitive. Some eligible fields for filtering are the - # following: - # - # + `target` - # + `policy` - # - # Some examples of filter queries: - # - # * `target:ex*`: The binding target's name starts with "ex". - # * `target:example`: The binding target's name is `example`. - # * `policy:example`: The binding policy's name is `example`. - class ListPolicyBindingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListPolicyBindings method. - # @!attribute [rw] policy_bindings - # @return [::Array<::Google::Iam::V3beta::PolicyBinding>] - # The policy bindings from the specified parent. - # @!attribute [rw] next_page_token - # @return [::String] - # Optional. A token, which can be sent as `page_token` to retrieve the next - # page. If this field is omitted, there are no subsequent pages. - class ListPolicyBindingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for SearchTargetPolicyBindings method. - # @!attribute [rw] target - # @return [::String] - # Required. The target resource, which is bound to the policy in the binding. - # - # Format: - # - # * `//iam.googleapis.com/locations/global/workforcePools/POOL_ID` - # * `//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID` - # * `//iam.googleapis.com/locations/global/workspace/WORKSPACE_ID` - # * `//cloudresourcemanager.googleapis.com/projects/{project_number}` - # * `//cloudresourcemanager.googleapis.com/folders/{folder_id}` - # * `//cloudresourcemanager.googleapis.com/organizations/{organization_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of policy bindings to return. The service may - # return fewer than this value. - # - # The default value is 50. The maximum value is 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous - # `SearchTargetPolicyBindingsRequest` call. Provide this to retrieve the - # subsequent page. - # - # When paginating, all other parameters provided to - # `SearchTargetPolicyBindingsRequest` must match the call that provided the - # page token. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this search will be performed. This - # should be the nearest Resource Manager resource (project, folder, or - # organization) to the target. - # - # Format: - # - # * `projects/{project_id}/locations/{location}` - # * `projects/{project_number}/locations/{location}` - # * `folders/{folder_id}/locations/{location}` - # * `organizations/{organization_id}/locations/{location}` - # @!attribute [rw] filter - # @return [::String] - # Optional. Filtering currently only supports the kind of policies to return, - # and must be in the format "policy_kind=\\{policy_kind}". - # - # If String is empty, bindings bound to all kinds of policies would be - # returned. - # - # The only supported values are the following: - # - # * "policy_kind=PRINCIPAL_ACCESS_BOUNDARY", - # * "policy_kind=ACCESS" - class SearchTargetPolicyBindingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for SearchTargetPolicyBindings method. - # @!attribute [rw] policy_bindings - # @return [::Array<::Google::Iam::V3beta::PolicyBinding>] - # The policy bindings bound to the specified target. - # @!attribute [rw] next_page_token - # @return [::String] - # Optional. A token, which can be sent as `page_token` to retrieve the next - # page. If this field is omitted, there are no subsequent pages. - class SearchTargetPolicyBindingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/principal_access_boundary_policies_service.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/principal_access_boundary_policies_service.rb deleted file mode 100644 index 565de307d98b..000000000000 --- a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/principal_access_boundary_policies_service.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Iam - module V3beta - # Request message for CreatePrincipalAccessBoundaryPolicyRequest method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this principal access boundary policy - # will be created. Only organizations are supported. - # - # Format: - # `organizations/{organization_id}/locations/{location}` - # @!attribute [rw] principal_access_boundary_policy_id - # @return [::String] - # Required. The ID to use for the principal access boundary policy, which - # will become the final component of the principal access boundary policy's - # resource name. - # - # This value must start with a lowercase letter followed by up to 62 - # lowercase letters, numbers, hyphens, or dots. Pattern, - # /[a-z][a-z0-9-\.]\\{2,62}/. - # @!attribute [rw] principal_access_boundary_policy - # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy] - # Required. The principal access boundary policy to create. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the creation, but do not - # actually post it. - class CreatePrincipalAccessBoundaryPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetPrincipalAccessBoundaryPolicy method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the principal access boundary policy to retrieve. - # - # Format: - # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` - class GetPrincipalAccessBoundaryPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdatePrincipalAccessBoundaryPolicy method. - # @!attribute [rw] principal_access_boundary_policy - # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy] - # Required. The principal access boundary policy to update. - # - # The principal access boundary policy's `name` field is used to identify the - # policy to update. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the update, but do not - # actually post it. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. The list of fields to update - class UpdatePrincipalAccessBoundaryPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeletePrincipalAccessBoundaryPolicy method. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the principal access boundary policy to delete. - # - # Format: - # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` - # @!attribute [rw] etag - # @return [::String] - # Optional. The etag of the principal access boundary policy. - # If this is provided, it must match the server's etag. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the deletion, but do not - # actually post it. - # @!attribute [rw] force - # @return [::Boolean] - # Optional. If set to true, the request will force the deletion of the policy - # even if the policy is referenced in policy bindings. - class DeletePrincipalAccessBoundaryPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListPrincipalAccessBoundaryPolicies method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource, which owns the collection of principal - # access boundary policies. - # - # Format: - # `organizations/{organization_id}/locations/{location}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of principal access boundary policies to - # return. The service may return fewer than this value. - # - # If unspecified, at most 50 principal access boundary policies will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous - # `ListPrincipalAccessBoundaryPolicies` call. Provide this to retrieve the - # subsequent page. - # - # When paginating, all other parameters provided to - # `ListPrincipalAccessBoundaryPolicies` must match the call that provided the - # page token. - class ListPrincipalAccessBoundaryPoliciesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListPrincipalAccessBoundaryPolicies method. - # @!attribute [rw] principal_access_boundary_policies - # @return [::Array<::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy>] - # The principal access boundary policies from the specified parent. - # @!attribute [rw] next_page_token - # @return [::String] - # Optional. A token, which can be sent as `page_token` to retrieve the next - # page. If this field is omitted, there are no subsequent pages. - class ListPrincipalAccessBoundaryPoliciesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for SearchPrincipalAccessBoundaryPolicyBindings rpc. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the principal access boundary policy. - # Format: - # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{principal_access_boundary_policy_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of policy bindings to return. The service may - # return fewer than this value. - # - # If unspecified, at most 50 policy bindings will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous - # `SearchPrincipalAccessBoundaryPolicyBindingsRequest` call. Provide this to - # retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `SearchPrincipalAccessBoundaryPolicyBindingsRequest` must match the call - # that provided the page token. - class SearchPrincipalAccessBoundaryPolicyBindingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for SearchPrincipalAccessBoundaryPolicyBindings rpc. - # @!attribute [rw] policy_bindings - # @return [::Array<::Google::Iam::V3beta::PolicyBinding>] - # The policy bindings that reference the specified policy. - # @!attribute [rw] next_page_token - # @return [::String] - # Optional. A token, which can be sent as `page_token` to retrieve the next - # page. If this field is omitted, there are no subsequent pages. - class SearchPrincipalAccessBoundaryPolicyBindingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/principal_access_boundary_policy_resources.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/principal_access_boundary_policy_resources.rb deleted file mode 100644 index a01db22285ba..000000000000 --- a/owl-bot-staging/google-iam-v3beta/proto_docs/google/iam/v3beta/principal_access_boundary_policy_resources.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 Iam - module V3beta - # An IAM principal access boundary policy resource. - # @!attribute [rw] name - # @return [::String] - # Identifier. The resource name of the principal access boundary policy. - # - # The following format is supported: - # `organizations/{organization_id}/locations/{location}/principalAccessBoundaryPolicies/{policy_id}` - # @!attribute [r] uid - # @return [::String] - # Output only. The globally unique ID of the principal access boundary - # policy. - # @!attribute [rw] etag - # @return [::String] - # Optional. The etag for the principal access boundary. - # If this is provided on update, it must match the server's etag. - # @!attribute [rw] display_name - # @return [::String] - # Optional. The description of the principal access boundary policy. Must be - # less than or equal to 63 characters. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. User defined annotations. See - # https://google.aip.dev/148#annotations for more details such as format and - # size limitations - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the principal access boundary policy was - # created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the principal access boundary policy was most - # recently updated. - # @!attribute [rw] details - # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicyDetails] - # Optional. The details for the principal access boundary policy. - class PrincipalAccessBoundaryPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Principal access boundary policy details - # @!attribute [rw] rules - # @return [::Array<::Google::Iam::V3beta::PrincipalAccessBoundaryPolicyRule>] - # Required. A list of principal access boundary policy rules. The number of - # rules in a policy is limited to 500. - # @!attribute [rw] enforcement_version - # @return [::String] - # Optional. - # The version number (for example, `1` or `latest`) that indicates which - # permissions are able to be blocked by the policy. If empty, the PAB policy - # version will be set to the most recent version number at the time of the - # policy's creation. - class PrincipalAccessBoundaryPolicyDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Principal access boundary policy rule that defines the resource boundary. - # @!attribute [rw] description - # @return [::String] - # Optional. The description of the principal access boundary policy rule. - # Must be less than or equal to 256 characters. - # @!attribute [rw] resources - # @return [::Array<::String>] - # Required. A list of Resource Manager resources. If a resource is listed in - # the rule, then the rule applies for that resource and its descendants. The - # number of resources in a policy is limited to 500 across all rules in the - # policy. - # - # The following resource types are supported: - # - # * Organizations, such as - # `//cloudresourcemanager.googleapis.com/organizations/123`. - # * Folders, such as `//cloudresourcemanager.googleapis.com/folders/123`. - # * Projects, such as `//cloudresourcemanager.googleapis.com/projects/123` - # or `//cloudresourcemanager.googleapis.com/projects/my-project-id`. - # @!attribute [rw] effect - # @return [::Google::Iam::V3beta::PrincipalAccessBoundaryPolicyRule::Effect] - # Required. The access relationship of principals to the resources in this - # rule. - class PrincipalAccessBoundaryPolicyRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An effect to describe the access relationship. - module Effect - # Effect unspecified. - EFFECT_UNSPECIFIED = 0 - - # Allows access to the resources in this rule. - ALLOW = 1 - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-iam-v3beta/proto_docs/google/longrunning/operations.rb +++ /dev/null @@ -1,191 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Longrunning - # This resource represents a long-running operation that is the result of a - # network API call. - # @!attribute [rw] name - # @return [::String] - # The server-assigned name, which is only unique within the same service that - # originally returns it. If you use the default HTTP mapping, the - # `name` should be a resource name ending with `operations/{unique_id}`. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Any] - # Service-specific metadata associated with the operation. It typically - # contains progress information and common metadata such as create time. - # Some services might not provide such metadata. Any method that returns a - # long-running operation should document the metadata type, if any. - # @!attribute [rw] done - # @return [::Boolean] - # If the value is `false`, it means the operation is still in progress. - # If `true`, the operation is completed, and either `error` or `response` is - # available. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # The error result of the operation in case of failure or cancellation. - # - # Note: The following fields are mutually exclusive: `error`, `response`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] response - # @return [::Google::Protobuf::Any] - # The normal, successful response of the operation. If the original - # method returns no data on success, such as `Delete`, the response is - # `google.protobuf.Empty`. If the original method is standard - # `Get`/`Create`/`Update`, the response should be the resource. For other - # methods, the response should have the type `XxxResponse`, where `Xxx` - # is the original method name. For example, if the original method name - # is `TakeSnapshot()`, the inferred response type is - # `TakeSnapshotResponse`. - # - # Note: The following fields are mutually exclusive: `response`, `error`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Operation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.GetOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource. - class GetOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.ListOperations. - # @!attribute [rw] name - # @return [::String] - # The name of the operation's parent resource. - # @!attribute [rw] filter - # @return [::String] - # The standard list filter. - # @!attribute [rw] page_size - # @return [::Integer] - # The standard list page size. - # @!attribute [rw] page_token - # @return [::String] - # The standard list page token. - # @!attribute [rw] return_partial_success - # @return [::Boolean] - # When set to `true`, operations that are reachable are returned as normal, - # and those that are unreachable are returned in the - # [ListOperationsResponse.unreachable] field. - # - # This can only be `true` when reading across collections e.g. when `parent` - # is set to `"projects/example/locations/-"`. - # - # This field is not by default supported and will result in an - # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in - # service or product specific documentation. - class ListOperationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for - # Operations.ListOperations. - # @!attribute [rw] operations - # @return [::Array<::Google::Longrunning::Operation>] - # A list of operations that matches the specified filter in the request. - # @!attribute [rw] next_page_token - # @return [::String] - # The standard List next-page token. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unordered list. Unreachable resources. Populated when the request sets - # `ListOperationsRequest.return_partial_success` and reads across - # collections e.g. when attempting to list all resources across all supported - # locations. - class ListOperationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.CancelOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be cancelled. - class CancelOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.DeleteOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to be deleted. - class DeleteOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for - # Operations.WaitOperation. - # @!attribute [rw] name - # @return [::String] - # The name of the operation resource to wait on. - # @!attribute [rw] timeout - # @return [::Google::Protobuf::Duration] - # The maximum duration to wait before timing out. If left blank, the wait - # will be at most the time permitted by the underlying HTTP/RPC protocol. - # If RPC context deadline is also specified, the shorter one will be used. - class WaitOperationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message representing the message types used by a long-running operation. - # - # Example: - # - # rpc Export(ExportRequest) returns (google.longrunning.Operation) { - # option (google.longrunning.operation_info) = { - # response_type: "ExportResponse" - # metadata_type: "ExportMetadata" - # }; - # } - # @!attribute [rw] response_type - # @return [::String] - # Required. The message name of the primary return type for this - # long-running operation. - # This type will be used to deserialize the LRO's response. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - # @!attribute [rw] metadata_type - # @return [::String] - # Required. The message name of the metadata type for this long-running - # operation. - # - # If the response is in a different package from the rpc, a fully-qualified - # message name must be used (e.g. `google.protobuf.Struct`). - # - # Note: Altering this value constitutes a breaking change. - class OperationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/any.rb +++ /dev/null @@ -1,145 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Protobuf - # `Any` contains an arbitrary serialized protocol buffer message along with a - # URL that describes the type of the serialized message. - # - # Protobuf library provides support to pack/unpack Any values in the form - # of utility functions or additional generated methods of the Any type. - # - # Example 1: Pack and unpack a message in C++. - # - # Foo foo = ...; - # Any any; - # any.PackFrom(foo); - # ... - # if (any.UnpackTo(&foo)) { - # ... - # } - # - # Example 2: Pack and unpack a message in Java. - # - # Foo foo = ...; - # Any any = Any.pack(foo); - # ... - # if (any.is(Foo.class)) { - # foo = any.unpack(Foo.class); - # } - # // or ... - # if (any.isSameTypeAs(Foo.getDefaultInstance())) { - # foo = any.unpack(Foo.getDefaultInstance()); - # } - # - # Example 3: Pack and unpack a message in Python. - # - # foo = Foo(...) - # any = Any() - # any.Pack(foo) - # ... - # if any.Is(Foo.DESCRIPTOR): - # any.Unpack(foo) - # ... - # - # Example 4: Pack and unpack a message in Go - # - # foo := &pb.Foo{...} - # any, err := anypb.New(foo) - # if err != nil { - # ... - # } - # ... - # foo := &pb.Foo{} - # if err := any.UnmarshalTo(foo); err != nil { - # ... - # } - # - # The pack methods provided by protobuf library will by default use - # 'type.googleapis.com/full.type.name' as the type URL and the unpack - # methods only use the fully qualified type name after the last '/' - # in the type URL, for example "foo.bar.com/x/y.z" will yield type - # name "y.z". - # - # JSON - # ==== - # The JSON representation of an `Any` value uses the regular - # representation of the deserialized, embedded message, with an - # additional field `@type` which contains the type URL. Example: - # - # package google.profile; - # message Person { - # string first_name = 1; - # string last_name = 2; - # } - # - # { - # "@type": "type.googleapis.com/google.profile.Person", - # "firstName": , - # "lastName": - # } - # - # If the embedded message type is well-known and has a custom JSON - # representation, that representation will be embedded adding a field - # `value` which holds the custom JSON in addition to the `@type` - # field. Example (for message [google.protobuf.Duration][]): - # - # { - # "@type": "type.googleapis.com/google.protobuf.Duration", - # "value": "1.212s" - # } - # @!attribute [rw] type_url - # @return [::String] - # A URL/resource name that uniquely identifies the type of the serialized - # protocol buffer message. This string must contain at least - # one "/" character. The last segment of the URL's path must represent - # the fully qualified name of the type (as in - # `path/google.protobuf.Duration`). The name should be in a canonical form - # (e.g., leading "." is not accepted). - # - # In practice, teams usually precompile into the binary all types that they - # expect it to use in the context of Any. However, for URLs which use the - # scheme `http`, `https`, or no scheme, one can optionally set up a type - # server that maps type URLs to message definitions as follows: - # - # * If no scheme is provided, `https` is assumed. - # * An HTTP GET on the URL must yield a [google.protobuf.Type][] - # value in binary format, or produce an error. - # * Applications are allowed to cache lookup results based on the - # URL, or have them precompiled into a binary to avoid any - # lookup. Therefore, binary compatibility needs to be preserved - # on changes to types. (Use versioned type names to manage - # breaking changes.) - # - # Note: this functionality is not currently available in the official - # protobuf release, and it is not used for type URLs beginning with - # type.googleapis.com. As of May 2023, there are no widely used type server - # implementations and no plans to implement one. - # - # Schemes other than `http`, `https` (or the empty scheme) might be - # used with implementation specific semantics. - # @!attribute [rw] value - # @return [::String] - # Must be a valid serialized protocol buffer of the above specified type. - class Any - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-iam-v3beta/proto_docs/google/rpc/status.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - - -module Google - module Rpc - # The `Status` type defines a logical error model that is suitable for - # different programming environments, including REST APIs and RPC APIs. It is - # used by [gRPC](https://github.com/grpc). Each `Status` message contains - # three pieces of data: error code, error message, and error details. - # - # You can find out more about this error model and how to work with it in the - # [API Design Guide](https://cloud.google.com/apis/design/errors). - # @!attribute [rw] code - # @return [::Integer] - # The status code, which should be an enum value of - # [google.rpc.Code][google.rpc.Code]. - # @!attribute [rw] message - # @return [::String] - # A developer-facing error message, which should be in English. Any - # user-facing error message should be localized and sent in the - # {::Google::Rpc::Status#details google.rpc.Status.details} field, or localized - # by the client. - # @!attribute [rw] details - # @return [::Array<::Google::Protobuf::Any>] - # A list of messages that carry the error details. There is a common set of - # message types for APIs to use. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/proto_docs/google/type/expr.rb b/owl-bot-staging/google-iam-v3beta/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-iam-v3beta/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-iam-v3beta/snippets/Gemfile b/owl-bot-staging/google-iam-v3beta/snippets/Gemfile deleted file mode 100644 index 96e4d901d459..000000000000 --- a/owl-bot-staging/google-iam-v3beta/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-iam-v3beta", path: "../" -else - gem "google-cloud-iam-v3beta" -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-iam-v3beta/snippets/policy_bindings/create_policy_binding.rb b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/create_policy_binding.rb deleted file mode 100644 index 71d915589110..000000000000 --- a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/create_policy_binding.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START iam_v3beta_generated_PolicyBindings_CreatePolicyBinding_sync] -require "google/iam/v3beta" - -## -# Snippet for the create_policy_binding call in the PolicyBindings service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Iam::V3beta::PolicyBindings::Client#create_policy_binding. -# -def create_policy_binding - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V3beta::PolicyBindings::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V3beta::CreatePolicyBindingRequest.new - - # Call the create_policy_binding method. - result = client.create_policy_binding request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END iam_v3beta_generated_PolicyBindings_CreatePolicyBinding_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/delete_policy_binding.rb b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/delete_policy_binding.rb deleted file mode 100644 index 71f4b669183c..000000000000 --- a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/delete_policy_binding.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START iam_v3beta_generated_PolicyBindings_DeletePolicyBinding_sync] -require "google/iam/v3beta" - -## -# Snippet for the delete_policy_binding call in the PolicyBindings service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Iam::V3beta::PolicyBindings::Client#delete_policy_binding. -# -def delete_policy_binding - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V3beta::PolicyBindings::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V3beta::DeletePolicyBindingRequest.new - - # Call the delete_policy_binding method. - result = client.delete_policy_binding request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END iam_v3beta_generated_PolicyBindings_DeletePolicyBinding_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/get_policy_binding.rb b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/get_policy_binding.rb deleted file mode 100644 index 95a37b3bd52d..000000000000 --- a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/get_policy_binding.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 iam_v3beta_generated_PolicyBindings_GetPolicyBinding_sync] -require "google/iam/v3beta" - -## -# Snippet for the get_policy_binding call in the PolicyBindings service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Iam::V3beta::PolicyBindings::Client#get_policy_binding. -# -def get_policy_binding - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V3beta::PolicyBindings::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V3beta::GetPolicyBindingRequest.new - - # Call the get_policy_binding method. - result = client.get_policy_binding request - - # The returned object is of type Google::Iam::V3beta::PolicyBinding. - p result -end -# [END iam_v3beta_generated_PolicyBindings_GetPolicyBinding_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/list_policy_bindings.rb b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/list_policy_bindings.rb deleted file mode 100644 index 0f7e29a87412..000000000000 --- a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/list_policy_bindings.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 iam_v3beta_generated_PolicyBindings_ListPolicyBindings_sync] -require "google/iam/v3beta" - -## -# Snippet for the list_policy_bindings call in the PolicyBindings service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Iam::V3beta::PolicyBindings::Client#list_policy_bindings. -# -def list_policy_bindings - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V3beta::PolicyBindings::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V3beta::ListPolicyBindingsRequest.new - - # Call the list_policy_bindings method. - result = client.list_policy_bindings 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::Iam::V3beta::PolicyBinding. - p item - end -end -# [END iam_v3beta_generated_PolicyBindings_ListPolicyBindings_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/search_target_policy_bindings.rb b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/search_target_policy_bindings.rb deleted file mode 100644 index f27b0677d25b..000000000000 --- a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/search_target_policy_bindings.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 iam_v3beta_generated_PolicyBindings_SearchTargetPolicyBindings_sync] -require "google/iam/v3beta" - -## -# Snippet for the search_target_policy_bindings call in the PolicyBindings service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Iam::V3beta::PolicyBindings::Client#search_target_policy_bindings. -# -def search_target_policy_bindings - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V3beta::PolicyBindings::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new - - # Call the search_target_policy_bindings method. - result = client.search_target_policy_bindings 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::Iam::V3beta::PolicyBinding. - p item - end -end -# [END iam_v3beta_generated_PolicyBindings_SearchTargetPolicyBindings_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/update_policy_binding.rb b/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/update_policy_binding.rb deleted file mode 100644 index 135862214560..000000000000 --- a/owl-bot-staging/google-iam-v3beta/snippets/policy_bindings/update_policy_binding.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START iam_v3beta_generated_PolicyBindings_UpdatePolicyBinding_sync] -require "google/iam/v3beta" - -## -# Snippet for the update_policy_binding call in the PolicyBindings service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Iam::V3beta::PolicyBindings::Client#update_policy_binding. -# -def update_policy_binding - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V3beta::PolicyBindings::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V3beta::UpdatePolicyBindingRequest.new - - # Call the update_policy_binding method. - result = client.update_policy_binding request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END iam_v3beta_generated_PolicyBindings_UpdatePolicyBinding_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/create_principal_access_boundary_policy.rb b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/create_principal_access_boundary_policy.rb deleted file mode 100644 index 5adbcf4dcc27..000000000000 --- a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/create_principal_access_boundary_policy.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START iam_v3beta_generated_PrincipalAccessBoundaryPolicies_CreatePrincipalAccessBoundaryPolicy_sync] -require "google/iam/v3beta" - -## -# Snippet for the create_principal_access_boundary_policy call in the PrincipalAccessBoundaryPolicies service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#create_principal_access_boundary_policy. -# -def create_principal_access_boundary_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest.new - - # Call the create_principal_access_boundary_policy method. - result = client.create_principal_access_boundary_policy request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END iam_v3beta_generated_PrincipalAccessBoundaryPolicies_CreatePrincipalAccessBoundaryPolicy_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/delete_principal_access_boundary_policy.rb b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/delete_principal_access_boundary_policy.rb deleted file mode 100644 index 80a3f6830daa..000000000000 --- a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/delete_principal_access_boundary_policy.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START iam_v3beta_generated_PrincipalAccessBoundaryPolicies_DeletePrincipalAccessBoundaryPolicy_sync] -require "google/iam/v3beta" - -## -# Snippet for the delete_principal_access_boundary_policy call in the PrincipalAccessBoundaryPolicies service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#delete_principal_access_boundary_policy. -# -def delete_principal_access_boundary_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest.new - - # Call the delete_principal_access_boundary_policy method. - result = client.delete_principal_access_boundary_policy request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END iam_v3beta_generated_PrincipalAccessBoundaryPolicies_DeletePrincipalAccessBoundaryPolicy_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/get_principal_access_boundary_policy.rb b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/get_principal_access_boundary_policy.rb deleted file mode 100644 index a6c6b2d32724..000000000000 --- a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/get_principal_access_boundary_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 iam_v3beta_generated_PrincipalAccessBoundaryPolicies_GetPrincipalAccessBoundaryPolicy_sync] -require "google/iam/v3beta" - -## -# Snippet for the get_principal_access_boundary_policy call in the PrincipalAccessBoundaryPolicies service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#get_principal_access_boundary_policy. -# -def get_principal_access_boundary_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest.new - - # Call the get_principal_access_boundary_policy method. - result = client.get_principal_access_boundary_policy request - - # The returned object is of type Google::Iam::V3beta::PrincipalAccessBoundaryPolicy. - p result -end -# [END iam_v3beta_generated_PrincipalAccessBoundaryPolicies_GetPrincipalAccessBoundaryPolicy_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/list_principal_access_boundary_policies.rb b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/list_principal_access_boundary_policies.rb deleted file mode 100644 index 6d15a7805873..000000000000 --- a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/list_principal_access_boundary_policies.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 iam_v3beta_generated_PrincipalAccessBoundaryPolicies_ListPrincipalAccessBoundaryPolicies_sync] -require "google/iam/v3beta" - -## -# Snippet for the list_principal_access_boundary_policies call in the PrincipalAccessBoundaryPolicies service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#list_principal_access_boundary_policies. -# -def list_principal_access_boundary_policies - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest.new - - # Call the list_principal_access_boundary_policies method. - result = client.list_principal_access_boundary_policies 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::Iam::V3beta::PrincipalAccessBoundaryPolicy. - p item - end -end -# [END iam_v3beta_generated_PrincipalAccessBoundaryPolicies_ListPrincipalAccessBoundaryPolicies_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/search_principal_access_boundary_policy_bindings.rb b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/search_principal_access_boundary_policy_bindings.rb deleted file mode 100644 index f55151327579..000000000000 --- a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/search_principal_access_boundary_policy_bindings.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 iam_v3beta_generated_PrincipalAccessBoundaryPolicies_SearchPrincipalAccessBoundaryPolicyBindings_sync] -require "google/iam/v3beta" - -## -# Snippet for the search_principal_access_boundary_policy_bindings call in the PrincipalAccessBoundaryPolicies service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#search_principal_access_boundary_policy_bindings. -# -def search_principal_access_boundary_policy_bindings - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest.new - - # Call the search_principal_access_boundary_policy_bindings method. - result = client.search_principal_access_boundary_policy_bindings 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::Iam::V3beta::PolicyBinding. - p item - end -end -# [END iam_v3beta_generated_PrincipalAccessBoundaryPolicies_SearchPrincipalAccessBoundaryPolicyBindings_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/update_principal_access_boundary_policy.rb b/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/update_principal_access_boundary_policy.rb deleted file mode 100644 index 821e090ddea2..000000000000 --- a/owl-bot-staging/google-iam-v3beta/snippets/principal_access_boundary_policies/update_principal_access_boundary_policy.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -# [START iam_v3beta_generated_PrincipalAccessBoundaryPolicies_UpdatePrincipalAccessBoundaryPolicy_sync] -require "google/iam/v3beta" - -## -# Snippet for the update_principal_access_boundary_policy call in the PrincipalAccessBoundaryPolicies service -# -# This snippet has been automatically generated and should be regarded as a code -# template only. It will require modifications to work: -# - It may require correct/in-range values for request initialization. -# - It may require specifying regional endpoints when creating the service -# client as shown in https://cloud.google.com/ruby/docs/reference. -# -# This is an auto-generated example demonstrating basic usage of -# Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#update_principal_access_boundary_policy. -# -def update_principal_access_boundary_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest.new - - # Call the update_principal_access_boundary_policy method. - result = client.update_principal_access_boundary_policy request - - # The returned object is of type Gapic::Operation. You can use it to - # check the status of an operation, cancel it, or wait for results. - # Here is how to wait for a response. - result.wait_until_done! timeout: 60 - if result.response? - p result.response - else - puts "No response received." - end -end -# [END iam_v3beta_generated_PrincipalAccessBoundaryPolicies_UpdatePrincipalAccessBoundaryPolicy_sync] diff --git a/owl-bot-staging/google-iam-v3beta/snippets/snippet_metadata_google.iam.v3beta.json b/owl-bot-staging/google-iam-v3beta/snippets/snippet_metadata_google.iam.v3beta.json deleted file mode 100644 index 88bdb8b21993..000000000000 --- a/owl-bot-staging/google-iam-v3beta/snippets/snippet_metadata_google.iam.v3beta.json +++ /dev/null @@ -1,735 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-iam-v3beta", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.iam.v3beta", - "version": "v3beta" - } - ] - }, - "snippets": [ - { - "region_tag": "iam_v3beta_generated_AccessPolicies_CreateAccessPolicy_sync", - "title": "Snippet for the create_access_policy call in the AccessPolicies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#create_access_policy.", - "file": "access_policies/create_access_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_access_policy", - "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#create_access_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::CreateAccessPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AccessPolicies::Client", - "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" - }, - "method": { - "short_name": "CreateAccessPolicy", - "full_name": "google.iam.v3beta.AccessPolicies.CreateAccessPolicy", - "service": { - "short_name": "AccessPolicies", - "full_name": "google.iam.v3beta.AccessPolicies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_AccessPolicies_GetAccessPolicy_sync", - "title": "Snippet for the get_access_policy call in the AccessPolicies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#get_access_policy.", - "file": "access_policies/get_access_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_access_policy", - "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#get_access_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::GetAccessPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V3beta::AccessPolicy", - "client": { - "short_name": "AccessPolicies::Client", - "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" - }, - "method": { - "short_name": "GetAccessPolicy", - "full_name": "google.iam.v3beta.AccessPolicies.GetAccessPolicy", - "service": { - "short_name": "AccessPolicies", - "full_name": "google.iam.v3beta.AccessPolicies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_AccessPolicies_UpdateAccessPolicy_sync", - "title": "Snippet for the update_access_policy call in the AccessPolicies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#update_access_policy.", - "file": "access_policies/update_access_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_access_policy", - "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#update_access_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::UpdateAccessPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AccessPolicies::Client", - "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" - }, - "method": { - "short_name": "UpdateAccessPolicy", - "full_name": "google.iam.v3beta.AccessPolicies.UpdateAccessPolicy", - "service": { - "short_name": "AccessPolicies", - "full_name": "google.iam.v3beta.AccessPolicies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_AccessPolicies_DeleteAccessPolicy_sync", - "title": "Snippet for the delete_access_policy call in the AccessPolicies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#delete_access_policy.", - "file": "access_policies/delete_access_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_access_policy", - "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#delete_access_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::DeleteAccessPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AccessPolicies::Client", - "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" - }, - "method": { - "short_name": "DeleteAccessPolicy", - "full_name": "google.iam.v3beta.AccessPolicies.DeleteAccessPolicy", - "service": { - "short_name": "AccessPolicies", - "full_name": "google.iam.v3beta.AccessPolicies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_AccessPolicies_ListAccessPolicies_sync", - "title": "Snippet for the list_access_policies call in the AccessPolicies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#list_access_policies.", - "file": "access_policies/list_access_policies.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_access_policies", - "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#list_access_policies", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::ListAccessPoliciesRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V3beta::ListAccessPoliciesResponse", - "client": { - "short_name": "AccessPolicies::Client", - "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" - }, - "method": { - "short_name": "ListAccessPolicies", - "full_name": "google.iam.v3beta.AccessPolicies.ListAccessPolicies", - "service": { - "short_name": "AccessPolicies", - "full_name": "google.iam.v3beta.AccessPolicies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_AccessPolicies_SearchAccessPolicyBindings_sync", - "title": "Snippet for the search_access_policy_bindings call in the AccessPolicies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::AccessPolicies::Client#search_access_policy_bindings.", - "file": "access_policies/search_access_policy_bindings.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_access_policy_bindings", - "full_name": "::Google::Iam::V3beta::AccessPolicies::Client#search_access_policy_bindings", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::SearchAccessPolicyBindingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V3beta::SearchAccessPolicyBindingsResponse", - "client": { - "short_name": "AccessPolicies::Client", - "full_name": "::Google::Iam::V3beta::AccessPolicies::Client" - }, - "method": { - "short_name": "SearchAccessPolicyBindings", - "full_name": "google.iam.v3beta.AccessPolicies.SearchAccessPolicyBindings", - "service": { - "short_name": "AccessPolicies", - "full_name": "google.iam.v3beta.AccessPolicies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_PolicyBindings_CreatePolicyBinding_sync", - "title": "Snippet for the create_policy_binding call in the PolicyBindings service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PolicyBindings::Client#create_policy_binding.", - "file": "policy_bindings/create_policy_binding.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_policy_binding", - "full_name": "::Google::Iam::V3beta::PolicyBindings::Client#create_policy_binding", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::CreatePolicyBindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "PolicyBindings::Client", - "full_name": "::Google::Iam::V3beta::PolicyBindings::Client" - }, - "method": { - "short_name": "CreatePolicyBinding", - "full_name": "google.iam.v3beta.PolicyBindings.CreatePolicyBinding", - "service": { - "short_name": "PolicyBindings", - "full_name": "google.iam.v3beta.PolicyBindings" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_PolicyBindings_GetPolicyBinding_sync", - "title": "Snippet for the get_policy_binding call in the PolicyBindings service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PolicyBindings::Client#get_policy_binding.", - "file": "policy_bindings/get_policy_binding.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_policy_binding", - "full_name": "::Google::Iam::V3beta::PolicyBindings::Client#get_policy_binding", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::GetPolicyBindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V3beta::PolicyBinding", - "client": { - "short_name": "PolicyBindings::Client", - "full_name": "::Google::Iam::V3beta::PolicyBindings::Client" - }, - "method": { - "short_name": "GetPolicyBinding", - "full_name": "google.iam.v3beta.PolicyBindings.GetPolicyBinding", - "service": { - "short_name": "PolicyBindings", - "full_name": "google.iam.v3beta.PolicyBindings" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_PolicyBindings_UpdatePolicyBinding_sync", - "title": "Snippet for the update_policy_binding call in the PolicyBindings service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PolicyBindings::Client#update_policy_binding.", - "file": "policy_bindings/update_policy_binding.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_policy_binding", - "full_name": "::Google::Iam::V3beta::PolicyBindings::Client#update_policy_binding", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::UpdatePolicyBindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "PolicyBindings::Client", - "full_name": "::Google::Iam::V3beta::PolicyBindings::Client" - }, - "method": { - "short_name": "UpdatePolicyBinding", - "full_name": "google.iam.v3beta.PolicyBindings.UpdatePolicyBinding", - "service": { - "short_name": "PolicyBindings", - "full_name": "google.iam.v3beta.PolicyBindings" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_PolicyBindings_DeletePolicyBinding_sync", - "title": "Snippet for the delete_policy_binding call in the PolicyBindings service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PolicyBindings::Client#delete_policy_binding.", - "file": "policy_bindings/delete_policy_binding.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_policy_binding", - "full_name": "::Google::Iam::V3beta::PolicyBindings::Client#delete_policy_binding", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::DeletePolicyBindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "PolicyBindings::Client", - "full_name": "::Google::Iam::V3beta::PolicyBindings::Client" - }, - "method": { - "short_name": "DeletePolicyBinding", - "full_name": "google.iam.v3beta.PolicyBindings.DeletePolicyBinding", - "service": { - "short_name": "PolicyBindings", - "full_name": "google.iam.v3beta.PolicyBindings" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_PolicyBindings_ListPolicyBindings_sync", - "title": "Snippet for the list_policy_bindings call in the PolicyBindings service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PolicyBindings::Client#list_policy_bindings.", - "file": "policy_bindings/list_policy_bindings.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_policy_bindings", - "full_name": "::Google::Iam::V3beta::PolicyBindings::Client#list_policy_bindings", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::ListPolicyBindingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V3beta::ListPolicyBindingsResponse", - "client": { - "short_name": "PolicyBindings::Client", - "full_name": "::Google::Iam::V3beta::PolicyBindings::Client" - }, - "method": { - "short_name": "ListPolicyBindings", - "full_name": "google.iam.v3beta.PolicyBindings.ListPolicyBindings", - "service": { - "short_name": "PolicyBindings", - "full_name": "google.iam.v3beta.PolicyBindings" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_PolicyBindings_SearchTargetPolicyBindings_sync", - "title": "Snippet for the search_target_policy_bindings call in the PolicyBindings service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PolicyBindings::Client#search_target_policy_bindings.", - "file": "policy_bindings/search_target_policy_bindings.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_target_policy_bindings", - "full_name": "::Google::Iam::V3beta::PolicyBindings::Client#search_target_policy_bindings", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V3beta::SearchTargetPolicyBindingsResponse", - "client": { - "short_name": "PolicyBindings::Client", - "full_name": "::Google::Iam::V3beta::PolicyBindings::Client" - }, - "method": { - "short_name": "SearchTargetPolicyBindings", - "full_name": "google.iam.v3beta.PolicyBindings.SearchTargetPolicyBindings", - "service": { - "short_name": "PolicyBindings", - "full_name": "google.iam.v3beta.PolicyBindings" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_PrincipalAccessBoundaryPolicies_CreatePrincipalAccessBoundaryPolicy_sync", - "title": "Snippet for the create_principal_access_boundary_policy call in the PrincipalAccessBoundaryPolicies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#create_principal_access_boundary_policy.", - "file": "principal_access_boundary_policies/create_principal_access_boundary_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_principal_access_boundary_policy", - "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#create_principal_access_boundary_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "PrincipalAccessBoundaryPolicies::Client", - "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client" - }, - "method": { - "short_name": "CreatePrincipalAccessBoundaryPolicy", - "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies.CreatePrincipalAccessBoundaryPolicy", - "service": { - "short_name": "PrincipalAccessBoundaryPolicies", - "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_PrincipalAccessBoundaryPolicies_GetPrincipalAccessBoundaryPolicy_sync", - "title": "Snippet for the get_principal_access_boundary_policy call in the PrincipalAccessBoundaryPolicies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#get_principal_access_boundary_policy.", - "file": "principal_access_boundary_policies/get_principal_access_boundary_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_principal_access_boundary_policy", - "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#get_principal_access_boundary_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy", - "client": { - "short_name": "PrincipalAccessBoundaryPolicies::Client", - "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client" - }, - "method": { - "short_name": "GetPrincipalAccessBoundaryPolicy", - "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies.GetPrincipalAccessBoundaryPolicy", - "service": { - "short_name": "PrincipalAccessBoundaryPolicies", - "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_PrincipalAccessBoundaryPolicies_UpdatePrincipalAccessBoundaryPolicy_sync", - "title": "Snippet for the update_principal_access_boundary_policy call in the PrincipalAccessBoundaryPolicies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#update_principal_access_boundary_policy.", - "file": "principal_access_boundary_policies/update_principal_access_boundary_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_principal_access_boundary_policy", - "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#update_principal_access_boundary_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "PrincipalAccessBoundaryPolicies::Client", - "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client" - }, - "method": { - "short_name": "UpdatePrincipalAccessBoundaryPolicy", - "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies.UpdatePrincipalAccessBoundaryPolicy", - "service": { - "short_name": "PrincipalAccessBoundaryPolicies", - "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_PrincipalAccessBoundaryPolicies_DeletePrincipalAccessBoundaryPolicy_sync", - "title": "Snippet for the delete_principal_access_boundary_policy call in the PrincipalAccessBoundaryPolicies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#delete_principal_access_boundary_policy.", - "file": "principal_access_boundary_policies/delete_principal_access_boundary_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_principal_access_boundary_policy", - "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#delete_principal_access_boundary_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "PrincipalAccessBoundaryPolicies::Client", - "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client" - }, - "method": { - "short_name": "DeletePrincipalAccessBoundaryPolicy", - "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies.DeletePrincipalAccessBoundaryPolicy", - "service": { - "short_name": "PrincipalAccessBoundaryPolicies", - "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_PrincipalAccessBoundaryPolicies_ListPrincipalAccessBoundaryPolicies_sync", - "title": "Snippet for the list_principal_access_boundary_policies call in the PrincipalAccessBoundaryPolicies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#list_principal_access_boundary_policies.", - "file": "principal_access_boundary_policies/list_principal_access_boundary_policies.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_principal_access_boundary_policies", - "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#list_principal_access_boundary_policies", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesResponse", - "client": { - "short_name": "PrincipalAccessBoundaryPolicies::Client", - "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client" - }, - "method": { - "short_name": "ListPrincipalAccessBoundaryPolicies", - "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies.ListPrincipalAccessBoundaryPolicies", - "service": { - "short_name": "PrincipalAccessBoundaryPolicies", - "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v3beta_generated_PrincipalAccessBoundaryPolicies_SearchPrincipalAccessBoundaryPolicyBindings_sync", - "title": "Snippet for the search_principal_access_boundary_policy_bindings call in the PrincipalAccessBoundaryPolicies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#search_principal_access_boundary_policy_bindings.", - "file": "principal_access_boundary_policies/search_principal_access_boundary_policy_bindings.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_principal_access_boundary_policy_bindings", - "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client#search_principal_access_boundary_policy_bindings", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsResponse", - "client": { - "short_name": "PrincipalAccessBoundaryPolicies::Client", - "full_name": "::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client" - }, - "method": { - "short_name": "SearchPrincipalAccessBoundaryPolicyBindings", - "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies.SearchPrincipalAccessBoundaryPolicyBindings", - "service": { - "short_name": "PrincipalAccessBoundaryPolicies", - "full_name": "google.iam.v3beta.PrincipalAccessBoundaryPolicies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_operations_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_operations_test.rb deleted file mode 100644 index 511734647747..000000000000 --- a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/iam/v3beta/policy_bindings_service_pb" -require "google/iam/v3beta/policy_bindings_service_services_pb" -require "google/iam/v3beta/policy_bindings" - -class ::Google::Iam::V3beta::PolicyBindings::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Iam::V3beta::PolicyBindings::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Iam::V3beta::PolicyBindings::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_paths_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_paths_test.rb deleted file mode 100644 index 25795739b50c..000000000000 --- a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_paths_test.rb +++ /dev/null @@ -1,97 +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/iam/v3beta/policy_bindings" - -class ::Google::Iam::V3beta::PolicyBindings::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_folder_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.folder_location_path folder: "value0", location: "value1" - assert_equal "folders/value0/locations/value1", path - end - end - - def test_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Iam::V3beta::PolicyBindings::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_organization_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.organization_location_path organization: "value0", location: "value1" - assert_equal "organizations/value0/locations/value1", path - end - end - - def test_policy_binding_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.policy_binding_path organization: "value0", location: "value1", policy_binding: "value2" - assert_equal "organizations/value0/locations/value1/policyBindings/value2", path - - path = client.policy_binding_path folder: "value0", location: "value1", policy_binding: "value2" - assert_equal "folders/value0/locations/value1/policyBindings/value2", path - - path = client.policy_binding_path project: "value0", location: "value1", policy_binding: "value2" - assert_equal "projects/value0/locations/value1/policyBindings/value2", path - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_rest_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_rest_test.rb deleted file mode 100644 index 4e42bfa38dda..000000000000 --- a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_rest_test.rb +++ /dev/null @@ -1,437 +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/iam/v3beta/policy_bindings_service_pb" -require "google/iam/v3beta/policy_bindings/rest" - - -class ::Google::Iam::V3beta::PolicyBindings::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_create_policy_binding - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - policy_binding_id = "hello world" - policy_binding = {} - validate_only = true - - create_policy_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Iam::V3beta::PolicyBindings::Rest::ServiceStub.stub :transcode_create_policy_binding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_policy_binding_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_policy_binding({ parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_policy_binding parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_policy_binding ::Google::Iam::V3beta::CreatePolicyBindingRequest.new(parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_policy_binding({ parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_policy_binding(::Google::Iam::V3beta::CreatePolicyBindingRequest.new(parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_policy_binding_client_stub.call_count - end - end - end - - def test_get_policy_binding - # Create test objects. - client_result = ::Google::Iam::V3beta::PolicyBinding.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_policy_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Iam::V3beta::PolicyBindings::Rest::ServiceStub.stub :transcode_get_policy_binding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_policy_binding_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_policy_binding({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_policy_binding name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_policy_binding ::Google::Iam::V3beta::GetPolicyBindingRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_policy_binding({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_policy_binding(::Google::Iam::V3beta::GetPolicyBindingRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_policy_binding_client_stub.call_count - end - end - end - - def test_update_policy_binding - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - policy_binding = {} - validate_only = true - update_mask = {} - - update_policy_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Iam::V3beta::PolicyBindings::Rest::ServiceStub.stub :transcode_update_policy_binding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_policy_binding_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_policy_binding({ policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_policy_binding policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_policy_binding ::Google::Iam::V3beta::UpdatePolicyBindingRequest.new(policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_policy_binding({ policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_policy_binding(::Google::Iam::V3beta::UpdatePolicyBindingRequest.new(policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_policy_binding_client_stub.call_count - end - end - end - - def test_delete_policy_binding - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - - delete_policy_binding_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Iam::V3beta::PolicyBindings::Rest::ServiceStub.stub :transcode_delete_policy_binding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_policy_binding_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_policy_binding({ name: name, etag: etag, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_policy_binding name: name, etag: etag, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_policy_binding ::Google::Iam::V3beta::DeletePolicyBindingRequest.new(name: name, etag: etag, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_policy_binding({ name: name, etag: etag, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_policy_binding(::Google::Iam::V3beta::DeletePolicyBindingRequest.new(name: name, etag: etag, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_policy_binding_client_stub.call_count - end - end - end - - def test_list_policy_bindings - # Create test objects. - client_result = ::Google::Iam::V3beta::ListPolicyBindingsResponse.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_policy_bindings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Iam::V3beta::PolicyBindings::Rest::ServiceStub.stub :transcode_list_policy_bindings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_policy_bindings_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_policy_bindings({ 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 - client.list_policy_bindings 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 - client.list_policy_bindings ::Google::Iam::V3beta::ListPolicyBindingsRequest.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 - client.list_policy_bindings({ 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 - client.list_policy_bindings(::Google::Iam::V3beta::ListPolicyBindingsRequest.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_policy_bindings_client_stub.call_count - end - end - end - - def test_search_target_policy_bindings - # Create test objects. - client_result = ::Google::Iam::V3beta::SearchTargetPolicyBindingsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - target = "hello world" - page_size = 42 - page_token = "hello world" - parent = "hello world" - filter = "hello world" - - search_target_policy_bindings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Iam::V3beta::PolicyBindings::Rest::ServiceStub.stub :transcode_search_target_policy_bindings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_target_policy_bindings_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_target_policy_bindings({ target: target, page_size: page_size, page_token: page_token, parent: parent, filter: filter }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_target_policy_bindings target: target, page_size: page_size, page_token: page_token, parent: parent, filter: filter do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_target_policy_bindings ::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new(target: target, page_size: page_size, page_token: page_token, parent: parent, filter: filter) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_target_policy_bindings({ target: target, page_size: page_size, page_token: page_token, parent: parent, filter: filter }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_target_policy_bindings(::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new(target: target, page_size: page_size, page_token: page_token, parent: parent, filter: filter), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_target_policy_bindings_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Iam::V3beta::PolicyBindings::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Iam::V3beta::PolicyBindings::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_test.rb deleted file mode 100644 index be97e0981402..000000000000 --- a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/policy_bindings_test.rb +++ /dev/null @@ -1,519 +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/iam/v3beta/policy_bindings_service_pb" -require "google/iam/v3beta/policy_bindings" - -class ::Google::Iam::V3beta::PolicyBindings::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_policy_binding - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - policy_binding_id = "hello world" - policy_binding = {} - validate_only = true - - create_policy_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_policy_binding, name - assert_kind_of ::Google::Iam::V3beta::CreatePolicyBindingRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["policy_binding_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V3beta::PolicyBinding), request["policy_binding"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_policy_binding_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_policy_binding({ parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_policy_binding parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_policy_binding ::Google::Iam::V3beta::CreatePolicyBindingRequest.new(parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_policy_binding({ parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_policy_binding(::Google::Iam::V3beta::CreatePolicyBindingRequest.new(parent: parent, policy_binding_id: policy_binding_id, policy_binding: policy_binding, validate_only: validate_only), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_policy_binding_client_stub.call_rpc_count - end - end - - def test_get_policy_binding - # Create GRPC objects. - grpc_response = ::Google::Iam::V3beta::PolicyBinding.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_policy_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_policy_binding, name - assert_kind_of ::Google::Iam::V3beta::GetPolicyBindingRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_policy_binding_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_policy_binding({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_policy_binding name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_policy_binding ::Google::Iam::V3beta::GetPolicyBindingRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_policy_binding({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_policy_binding(::Google::Iam::V3beta::GetPolicyBindingRequest.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_policy_binding_client_stub.call_rpc_count - end - end - - def test_update_policy_binding - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - policy_binding = {} - validate_only = true - update_mask = {} - - update_policy_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_policy_binding, name - assert_kind_of ::Google::Iam::V3beta::UpdatePolicyBindingRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V3beta::PolicyBinding), request["policy_binding"] - assert_equal true, request["validate_only"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_policy_binding_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_policy_binding({ policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_policy_binding policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_policy_binding ::Google::Iam::V3beta::UpdatePolicyBindingRequest.new(policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_policy_binding({ policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_policy_binding(::Google::Iam::V3beta::UpdatePolicyBindingRequest.new(policy_binding: policy_binding, validate_only: validate_only, update_mask: update_mask), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_policy_binding_client_stub.call_rpc_count - end - end - - def test_delete_policy_binding - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - - delete_policy_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_policy_binding, name - assert_kind_of ::Google::Iam::V3beta::DeletePolicyBindingRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_policy_binding_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_policy_binding({ name: name, etag: etag, validate_only: validate_only }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_policy_binding name: name, etag: etag, validate_only: validate_only do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_policy_binding ::Google::Iam::V3beta::DeletePolicyBindingRequest.new(name: name, etag: etag, validate_only: validate_only) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_policy_binding({ name: name, etag: etag, validate_only: validate_only }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_policy_binding(::Google::Iam::V3beta::DeletePolicyBindingRequest.new(name: name, etag: etag, validate_only: validate_only), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_policy_binding_client_stub.call_rpc_count - end - end - - def test_list_policy_bindings - # Create GRPC objects. - grpc_response = ::Google::Iam::V3beta::ListPolicyBindingsResponse.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_policy_bindings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_policy_bindings, name - assert_kind_of ::Google::Iam::V3beta::ListPolicyBindingsRequest, 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_policy_bindings_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_policy_bindings({ 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 - client.list_policy_bindings 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 - client.list_policy_bindings ::Google::Iam::V3beta::ListPolicyBindingsRequest.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 - client.list_policy_bindings({ 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 - client.list_policy_bindings(::Google::Iam::V3beta::ListPolicyBindingsRequest.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_policy_bindings_client_stub.call_rpc_count - end - end - - def test_search_target_policy_bindings - # Create GRPC objects. - grpc_response = ::Google::Iam::V3beta::SearchTargetPolicyBindingsResponse.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. - target = "hello world" - page_size = 42 - page_token = "hello world" - parent = "hello world" - filter = "hello world" - - search_target_policy_bindings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_target_policy_bindings, name - assert_kind_of ::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest, request - assert_equal "hello world", request["target"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_target_policy_bindings_client_stub do - # Create client - client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_target_policy_bindings({ target: target, page_size: page_size, page_token: page_token, parent: parent, 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 - client.search_target_policy_bindings target: target, page_size: page_size, page_token: page_token, parent: parent, 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 - client.search_target_policy_bindings ::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new(target: target, page_size: page_size, page_token: page_token, parent: parent, 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 - client.search_target_policy_bindings({ target: target, page_size: page_size, page_token: page_token, parent: parent, 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 - client.search_target_policy_bindings(::Google::Iam::V3beta::SearchTargetPolicyBindingsRequest.new(target: target, page_size: page_size, page_token: page_token, parent: parent, 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, search_target_policy_bindings_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Iam::V3beta::PolicyBindings::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Iam::V3beta::PolicyBindings::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Iam::V3beta::PolicyBindings::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Iam::V3beta::PolicyBindings::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_operations_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_operations_test.rb deleted file mode 100644 index ed86bcce8c03..000000000000 --- a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_operations_test.rb +++ /dev/null @@ -1,400 +0,0 @@ -# frozen_string_literal: true - -# Copyright 2026 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Auto-generated by gapic-generator-ruby. DO NOT EDIT! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/iam/v3beta/principal_access_boundary_policies_service_pb" -require "google/iam/v3beta/principal_access_boundary_policies_service_services_pb" -require "google/iam/v3beta/principal_access_boundary_policies" - -class ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::OperationsTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_list_operations - # Create GRPC objects. - grpc_response = ::Google::Longrunning::ListOperationsResponse.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - filter = "hello world" - page_size = 42 - page_token = "hello world" - return_partial_success = true - - list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operations, name - assert_kind_of ::Google::Longrunning::ListOperationsRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["filter"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["return_partial_success"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_operations_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token, return_partial_success: return_partial_success), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_operations_client_stub.call_rpc_count - end - end - - def test_get_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operation, name - assert_kind_of ::Google::Longrunning::GetOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operation_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operation({ name: name }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operation name: name do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operation({ name: name }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_operation_client_stub.call_rpc_count - end - end - - def test_delete_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operation, name - assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operation_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_operation_client_stub.call_rpc_count - end - end - - def test_cancel_operation - # Create GRPC objects. - grpc_response = ::Google::Protobuf::Empty.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_operation, name - assert_kind_of ::Google::Longrunning::CancelOperationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_operation_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_operation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_operation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_operation({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, cancel_operation_client_stub.call_rpc_count - end - end - - def test_wait_operation - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - timeout = {} - - wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :wait_operation, name - assert_kind_of ::Google::Longrunning::WaitOperationRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, wait_operation_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.wait_operation({ name: name, timeout: timeout }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.wait_operation name: name, timeout: timeout do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, wait_operation_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_paths_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_paths_test.rb deleted file mode 100644 index e7a89396ed57..000000000000 --- a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_paths_test.rb +++ /dev/null @@ -1,67 +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/iam/v3beta/principal_access_boundary_policies" - -class ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::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_organization_location_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.organization_location_path organization: "value0", location: "value1" - assert_equal "organizations/value0/locations/value1", path - end - end - - def test_principal_access_boundary_policy_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.principal_access_boundary_policy_path organization: "value0", location: "value1", principal_access_boundary_policy: "value2" - assert_equal "organizations/value0/locations/value1/principalAccessBoundaryPolicies/value2", path - end - end -end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_rest_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_rest_test.rb deleted file mode 100644 index c05429d23690..000000000000 --- a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_rest_test.rb +++ /dev/null @@ -1,435 +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/iam/v3beta/principal_access_boundary_policies_service_pb" -require "google/iam/v3beta/principal_access_boundary_policies/rest" - - -class ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::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_create_principal_access_boundary_policy - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - principal_access_boundary_policy_id = "hello world" - principal_access_boundary_policy = {} - validate_only = true - - create_principal_access_boundary_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::ServiceStub.stub :transcode_create_principal_access_boundary_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_principal_access_boundary_policy_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_principal_access_boundary_policy({ parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_principal_access_boundary_policy parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_principal_access_boundary_policy ::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest.new(parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_principal_access_boundary_policy({ parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_principal_access_boundary_policy(::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest.new(parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_principal_access_boundary_policy_client_stub.call_count - end - end - end - - def test_get_principal_access_boundary_policy - # Create test objects. - client_result = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_principal_access_boundary_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::ServiceStub.stub :transcode_get_principal_access_boundary_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_principal_access_boundary_policy_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_principal_access_boundary_policy({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_principal_access_boundary_policy name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_principal_access_boundary_policy ::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_principal_access_boundary_policy({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_principal_access_boundary_policy(::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_principal_access_boundary_policy_client_stub.call_count - end - end - end - - def test_update_principal_access_boundary_policy - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - principal_access_boundary_policy = {} - validate_only = true - update_mask = {} - - update_principal_access_boundary_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::ServiceStub.stub :transcode_update_principal_access_boundary_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_principal_access_boundary_policy_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_principal_access_boundary_policy({ principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_principal_access_boundary_policy principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_principal_access_boundary_policy ::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest.new(principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_principal_access_boundary_policy({ principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_principal_access_boundary_policy(::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest.new(principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_principal_access_boundary_policy_client_stub.call_count - end - end - end - - def test_delete_principal_access_boundary_policy - # Create test objects. - client_result = ::Google::Longrunning::Operation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - force = true - - delete_principal_access_boundary_policy_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::ServiceStub.stub :transcode_delete_principal_access_boundary_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_principal_access_boundary_policy_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_principal_access_boundary_policy({ name: name, etag: etag, validate_only: validate_only, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_principal_access_boundary_policy name: name, etag: etag, validate_only: validate_only, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_principal_access_boundary_policy ::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest.new(name: name, etag: etag, validate_only: validate_only, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_principal_access_boundary_policy({ name: name, etag: etag, validate_only: validate_only, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_principal_access_boundary_policy(::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest.new(name: name, etag: etag, validate_only: validate_only, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_principal_access_boundary_policy_client_stub.call_count - end - end - end - - def test_list_principal_access_boundary_policies - # Create test objects. - client_result = ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesResponse.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" - - list_principal_access_boundary_policies_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::ServiceStub.stub :transcode_list_principal_access_boundary_policies_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_principal_access_boundary_policies_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_principal_access_boundary_policies({ parent: parent, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_principal_access_boundary_policies parent: parent, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_principal_access_boundary_policies ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_principal_access_boundary_policies({ parent: parent, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_principal_access_boundary_policies(::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_principal_access_boundary_policies_client_stub.call_count - end - end - end - - def test_search_principal_access_boundary_policy_bindings - # Create test objects. - client_result = ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - page_size = 42 - page_token = "hello world" - - search_principal_access_boundary_policy_bindings_client_stub = ClientStub.new http_response do |_verb, uri:, body:, params:, options:, method_name:| - assert options.metadata.key? :"x-goog-api-client" - assert options.metadata[:"x-goog-api-client"].include? "rest" - refute options.metadata[:"x-goog-api-client"].include? "grpc" - end - - ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::ServiceStub.stub :transcode_search_principal_access_boundary_policy_bindings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_principal_access_boundary_policy_bindings_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_principal_access_boundary_policy_bindings({ name: name, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_principal_access_boundary_policy_bindings name: name, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_principal_access_boundary_policy_bindings ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest.new(name: name, page_size: page_size, page_token: page_token) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_principal_access_boundary_policy_bindings({ name: name, page_size: page_size, page_token: page_token }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_principal_access_boundary_policy_bindings(::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest.new(name: name, page_size: page_size, page_token: page_token), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_principal_access_boundary_policy_bindings_client_stub.call_count - end - end - end - - def test_configure - credentials_token = :dummy_value - - client = block_config = config = nil - dummy_stub = ClientStub.new nil - Gapic::Rest::ClientStub.stub :new, dummy_stub do - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client.new do |config| - config.credentials = credentials_token - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_test.rb b/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_test.rb deleted file mode 100644 index 276b103f56aa..000000000000 --- a/owl-bot-staging/google-iam-v3beta/test/google/iam/v3beta/principal_access_boundary_policies_test.rb +++ /dev/null @@ -1,515 +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/iam/v3beta/principal_access_boundary_policies_service_pb" -require "google/iam/v3beta/principal_access_boundary_policies" - -class ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::ClientTest < Minitest::Test - class ClientStub - attr_accessor :call_rpc_count, :requests - - def initialize response, operation, &block - @response = response - @operation = operation - @block = block - @call_rpc_count = 0 - @requests = [] - end - - def call_rpc *args, **kwargs - @call_rpc_count += 1 - - @requests << @block&.call(*args, **kwargs) - - catch :response do - yield @response, @operation if block_given? - @response - end - end - - def endpoint - "endpoint.example.com" - end - - def universe_domain - "example.com" - end - - def stub_logger - nil - end - - def logger - nil - end - end - - def test_create_principal_access_boundary_policy - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - principal_access_boundary_policy_id = "hello world" - principal_access_boundary_policy = {} - validate_only = true - - create_principal_access_boundary_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_principal_access_boundary_policy, name - assert_kind_of ::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["principal_access_boundary_policy_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy), request["principal_access_boundary_policy"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_principal_access_boundary_policy_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_principal_access_boundary_policy({ parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_principal_access_boundary_policy parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_principal_access_boundary_policy ::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest.new(parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_principal_access_boundary_policy({ parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_principal_access_boundary_policy(::Google::Iam::V3beta::CreatePrincipalAccessBoundaryPolicyRequest.new(parent: parent, principal_access_boundary_policy_id: principal_access_boundary_policy_id, principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_principal_access_boundary_policy_client_stub.call_rpc_count - end - end - - def test_get_principal_access_boundary_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy.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_principal_access_boundary_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_principal_access_boundary_policy, name - assert_kind_of ::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_principal_access_boundary_policy_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_principal_access_boundary_policy({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_principal_access_boundary_policy name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_principal_access_boundary_policy ::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_principal_access_boundary_policy({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_principal_access_boundary_policy(::Google::Iam::V3beta::GetPrincipalAccessBoundaryPolicyRequest.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_principal_access_boundary_policy_client_stub.call_rpc_count - end - end - - def test_update_principal_access_boundary_policy - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - principal_access_boundary_policy = {} - validate_only = true - update_mask = {} - - update_principal_access_boundary_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_principal_access_boundary_policy, name - assert_kind_of ::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicy), request["principal_access_boundary_policy"] - assert_equal true, request["validate_only"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_principal_access_boundary_policy_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_principal_access_boundary_policy({ principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_principal_access_boundary_policy principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_principal_access_boundary_policy ::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest.new(principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.update_principal_access_boundary_policy({ principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.update_principal_access_boundary_policy(::Google::Iam::V3beta::UpdatePrincipalAccessBoundaryPolicyRequest.new(principal_access_boundary_policy: principal_access_boundary_policy, validate_only: validate_only, update_mask: update_mask), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, update_principal_access_boundary_policy_client_stub.call_rpc_count - end - end - - def test_delete_principal_access_boundary_policy - # Create GRPC objects. - grpc_response = ::Google::Longrunning::Operation.new - grpc_operation = GRPC::ActiveCall::Operation.new nil - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - grpc_options = {} - - # Create request parameters for a unary method. - name = "hello world" - etag = "hello world" - validate_only = true - force = true - - delete_principal_access_boundary_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_principal_access_boundary_policy, name - assert_kind_of ::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - assert_equal true, request["validate_only"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_principal_access_boundary_policy_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_principal_access_boundary_policy({ name: name, etag: etag, validate_only: validate_only, force: force }) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_principal_access_boundary_policy name: name, etag: etag, validate_only: validate_only, force: force do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_principal_access_boundary_policy ::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest.new(name: name, etag: etag, validate_only: validate_only, force: force) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_principal_access_boundary_policy({ name: name, etag: etag, validate_only: validate_only, force: force }, grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.delete_principal_access_boundary_policy(::Google::Iam::V3beta::DeletePrincipalAccessBoundaryPolicyRequest.new(name: name, etag: etag, validate_only: validate_only, force: force), grpc_options) do |response, operation| - assert_kind_of Gapic::Operation, response - assert_equal grpc_response, response.grpc_op - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, delete_principal_access_boundary_policy_client_stub.call_rpc_count - end - end - - def test_list_principal_access_boundary_policies - # Create GRPC objects. - grpc_response = ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesResponse.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" - - list_principal_access_boundary_policies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_principal_access_boundary_policies, name - assert_kind_of ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_principal_access_boundary_policies_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_principal_access_boundary_policies({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_principal_access_boundary_policies parent: parent, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_principal_access_boundary_policies ::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_principal_access_boundary_policies({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_principal_access_boundary_policies(::Google::Iam::V3beta::ListPrincipalAccessBoundaryPoliciesRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, list_principal_access_boundary_policies_client_stub.call_rpc_count - end - end - - def test_search_principal_access_boundary_policy_bindings - # Create GRPC objects. - grpc_response = ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsResponse.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" - page_size = 42 - page_token = "hello world" - - search_principal_access_boundary_policy_bindings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_principal_access_boundary_policy_bindings, name - assert_kind_of ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_principal_access_boundary_policy_bindings_client_stub do - # Create client - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_principal_access_boundary_policy_bindings({ name: name, page_size: page_size, page_token: page_token }) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_principal_access_boundary_policy_bindings name: name, page_size: page_size, page_token: page_token do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_principal_access_boundary_policy_bindings ::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest.new(name: name, page_size: page_size, page_token: page_token) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_principal_access_boundary_policy_bindings({ name: name, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_principal_access_boundary_policy_bindings(::Google::Iam::V3beta::SearchPrincipalAccessBoundaryPolicyBindingsRequest.new(name: name, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| - assert_kind_of Gapic::PagedEnumerable, response - assert_equal grpc_response, response.response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_principal_access_boundary_policy_bindings_client_stub.call_rpc_count - end - end - - def test_configure - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = block_config = config = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| - config.credentials = grpc_channel - end - end - - config = client.configure do |c| - block_config = c - end - - assert_same block_config, config - assert_kind_of ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client::Configuration, config - end - - def test_credentials - key = OpenSSL::PKey::RSA.new 2048 - cred_json = { - "private_key" => key.to_pem, - "client_email" => "app@developer.gserviceaccount.com", - "type" => "service_account" - } - key_file = StringIO.new cred_json.to_json - creds = Google::Auth::ServiceAccountCredentials.make_creds({ json_key_io: key_file }) - - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client, client - assert_equal creds, client.configure.credentials - end - end - - def test_operations_client - grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - - client = nil - dummy_stub = ClientStub.new nil, nil - Gapic::ServiceStub.stub :new, dummy_stub do - client = ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Iam::V3beta::PrincipalAccessBoundaryPolicies::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-iam-v3beta/test/helper.rb b/owl-bot-staging/google-iam-v3beta/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-iam-v3beta/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"